summary refs log tree commit diff stats
path: root/target/hppa/mem_helper.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2024-01-11 22:50:11 +0100
committerHelge Deller <deller@gmx.de>2024-01-13 06:48:14 +0100
commit3824e0d643f34ee09e0cc75190c0c4b60928b78c (patch)
tree5164b2792c0aad88841f7193c1db66ff5b82771c /target/hppa/mem_helper.c
parent5915b67013eb8c3a84e3ef05e6ba4eae55ccd173 (diff)
downloadfocaccia-qemu-3824e0d643f34ee09e0cc75190c0c4b60928b78c.tar.gz
focaccia-qemu-3824e0d643f34ee09e0cc75190c0c4b60928b78c.zip
target/hppa: Export function hppa_set_ior_and_isr()
Move functionality to set IOR and ISR on fault into own
function. This will be used by follow-up patches.

Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/hppa/mem_helper.c')
-rw-r--r--target/hppa/mem_helper.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index 1387f4a64b..4fcc612754 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -305,14 +305,8 @@ hwaddr hppa_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
     return excp == EXCP_DTLB_MISS ? -1 : phys;
 }
 
-G_NORETURN static void
-raise_exception_with_ior(CPUHPPAState *env, int excp, uintptr_t retaddr,
-                         vaddr addr, bool mmu_disabled)
+void hppa_set_ior_and_isr(CPUHPPAState *env, vaddr addr, bool mmu_disabled)
 {
-    CPUState *cs = env_cpu(env);
-
-    cs->exception_index = excp;
-
     if (env->psw & PSW_Q) {
         /*
          * For pa1.x, the offset and space never overlap, and so we
@@ -339,16 +333,23 @@ raise_exception_with_ior(CPUHPPAState *env, int excp, uintptr_t retaddr,
                  */
                 uint64_t b;
 
-                cpu_restore_state(cs, retaddr);
-
                 b = env->unwind_breg ? env->gr[env->unwind_breg] : 0;
                 b >>= (env->psw & PSW_W ? 62 : 30);
                 env->cr[CR_IOR] |= b << 62;
-
-                cpu_loop_exit(cs);
             }
         }
     }
+}
+
+G_NORETURN static void
+raise_exception_with_ior(CPUHPPAState *env, int excp, uintptr_t retaddr,
+                         vaddr addr, bool mmu_disabled)
+{
+    CPUState *cs = env_cpu(env);
+
+    cs->exception_index = excp;
+    hppa_set_ior_and_isr(env, addr, mmu_disabled);
+
     cpu_loop_exit_restore(cs, retaddr);
 }