OSDN Git Service

target-ppc: convert wait instruction to TCG
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 30 Nov 2008 16:23:46 +0000 (16:23 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 30 Nov 2008 16:23:46 +0000 (16:23 +0000)
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5824 c046a42c-6fe2-441c-8c8c-71466251a162

target-ppc/op.c
target-ppc/op_helper.h
target-ppc/translate.c

index ee67546..16ab589 100644 (file)
@@ -290,12 +290,6 @@ void OPPROTO op_check_reservation_64 (void)
 }
 #endif
 
-void OPPROTO op_wait (void)
-{
-    env->halted = 1;
-    RETURN();
-}
-
 /* Return from interrupt */
 #if !defined(CONFIG_USER_ONLY)
 void OPPROTO op_rfi (void)
index 5e36f57..44f02d6 100644 (file)
@@ -85,11 +85,6 @@ void do_POWER_rfsvc (void);
 void do_store_hid0_601 (void);
 #endif
 
-/* PowerPC 602 specific helper */
-#if !defined(CONFIG_USER_ONLY)
-void do_op_602_mfrom (void);
-#endif
-
 /* PowerPC 440 specific helpers */
 #if !defined(CONFIG_USER_ONLY)
 void do_440_tlbre (int word);
index 63e17de..c831ea7 100644 (file)
@@ -3310,8 +3310,10 @@ GEN_HANDLER(sync, 0x1F, 0x16, 0x12, 0x039FF801, PPC_MEM_SYNC)
 /* wait */
 GEN_HANDLER(wait, 0x1F, 0x1E, 0x01, 0x03FFF801, PPC_WAIT)
 {
+    TCGv_i32 t0 = tcg_temp_new_i32();
+    tcg_gen_st_i32(t0, cpu_env, offsetof(CPUState, halted));
+    tcg_temp_free_i32(t0);
     /* Stop translation, as the CPU is supposed to sleep from now */
-    gen_op_wait();
     GEN_EXCP(ctx, EXCP_HLT, 1);
 }