Skip to contentSkip to conversation

[5989] target-ppc: rework exception code

Qemu-devel Aurelien Jarno 1 participant 1 message Dec 11, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5989

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5989
Author:   aurel32
Date:     2008-12-11 22:42:14 +0000 (Thu, 11 Dec 2008)

Log Message:
-----------
target-ppc: rework exception code

... also remove two warnings.

Modified Paths:
--------------
trunk/cpu-exec.c
trunk/target-ppc/exec.h
trunk/target-ppc/helper.c
trunk/target-ppc/helper.h
trunk/target-ppc/op_helper.c
trunk/target-ppc/translate.c
trunk/target-ppc/translate_init.c

Modified: trunk/cpu-exec.c
===================================================================

cpu-exec.c +1 -1
@@ -918,7 +918,7 @@
     /* we restore the process signal mask as the sigreturn should
        do it (XXX: use sigsetjmp) */
         sigprocmask(SIG_SETMASK, old_set, NULL);
-        raise_exception_err(env, env->exception_index, env->error_code);
+        cpu_loop_exit();
     } else {
         /* activate soft MMU for this block */
         cpu_resume_from_signal(env, puc);

Modified: trunk/target-ppc/exec.h
===================================================================

target-ppc/exec.h +0 -3
@@ -38,9 +38,6 @@
 #include "softmmu_exec.h"
 #endif /* !defined(CONFIG_USER_ONLY) */
 
-void raise_exception_err (CPUState *env, int exception, int error_code);
-void raise_exception (CPUState *env, int exception);
-
 int get_physical_address (CPUState *env, mmu_ctx_t *ctx, target_ulong vaddr,
                           int rw, int access_type);
 

Modified: trunk/target-ppc/helper.c
===================================================================

target-ppc/helper.c +0 -18
@@ -40,24 +40,6 @@
 //#define FLUSH_ALL_TLBS
 
 /*****************************************************************************/
-/* Exceptions processing */
-
-void raise_exception_err (CPUState *env, int exception, int error_code)
-{
-#if 0
-    printf("Raise exception %3x code : %d\n", exception, error_code);
-#endif
-    env->exception_index = exception;
-    env->error_code = error_code;
-    cpu_loop_exit();
-}
-
-void raise_exception (CPUState *env, int exception)
-{
-    helper_raise_exception_err(exception, 0);
-}
-
-/*****************************************************************************/
 /* PowerPC MMU emulation */
 
 #if defined(CONFIG_USER_ONLY)

Modified: trunk/target-ppc/helper.h
===================================================================

target-ppc/helper.h +1 -1
@@ -1,7 +1,7 @@
 #include "def-helper.h"
 
 DEF_HELPER_2(raise_exception_err, void, i32, i32)
-DEF_HELPER_0(raise_debug, void)
+DEF_HELPER_1(raise_exception, void, i32)
 DEF_HELPER_3(tw, void, tl, tl, i32)
 #if defined(TARGET_PPC64)
 DEF_HELPER_3(td, void, tl, tl, i32)

Modified: trunk/target-ppc/op_helper.c
===================================================================

target-ppc/op_helper.c +28 -23

134 lines not on this page · raw message

Modified: trunk/target-ppc/translate.c
===================================================================

target-ppc/translate.c +255 -255

1,604 lines not on this page · raw message

Modified: trunk/target-ppc/translate_init.c
===================================================================

target-ppc/translate_init.c +3 -3
@@ -347,7 +347,7 @@
 
     gen_helper_store_hid0_601(cpu_gpr[gprn]);
     /* Must stop the translation as endianness may have changed */
-    GEN_STOP(ctx);
+    gen_stop_exception(ctx);
 }
 #endif
 
@@ -391,7 +391,7 @@
 
     gen_helper_store_40x_dbcr0(cpu_gpr[gprn]);
     /* We must stop translation as we may have rebooted */
-    GEN_STOP(ctx);
+    gen_stop_exception(ctx);
 }
 
 static void spr_write_40x_sler (void *opaque, int sprn, int gprn)
@@ -466,7 +466,7 @@
     } else {
         printf("Trying to write an unknown exception vector %d %03x\n",
                sprn, sprn);
-        GEN_EXCP_PRIVREG(ctx);
+        gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG);
     }
 }
 #endif