Skip to contentSkip to conversation

[6762] Use a dedicated function to request exit from execution loop

Qemu-devel Aurelien Jarno 1 participant 1 message Mar 7, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6762

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6762
Author:   aurel32
Date:     2009-03-07 21:28:24 +0000 (Sat, 07 Mar 2009)

Log Message:
-----------
Use a dedicated function to request exit from execution loop

Modified Paths:
--------------
trunk/cpu-all.h
trunk/darwin-user/signal.c
trunk/exec.c
trunk/gdbstub.c
trunk/hw/dma.c
trunk/hw/mac_dbdma.c
trunk/linux-user/main.c
trunk/linux-user/signal.c
trunk/vl.c

Modified: trunk/cpu-all.h
===================================================================

cpu-all.h +2 -1
@@ -760,7 +760,6 @@
 extern int64_t qemu_icount;
 extern int use_icount;
 
-#define CPU_INTERRUPT_EXIT   0x01 /* wants exit from main loop */
 #define CPU_INTERRUPT_HARD   0x02 /* hardware interrupt pending */
 #define CPU_INTERRUPT_EXITTB 0x04 /* exit the current TB (use for x86 a20 case) */
 #define CPU_INTERRUPT_TIMER  0x08 /* internal timer exception pending */
@@ -774,6 +773,8 @@
 void cpu_interrupt(CPUState *s, int mask);
 void cpu_reset_interrupt(CPUState *env, int mask);
 
+void cpu_exit(CPUState *s);
+
 /* Breakpoint/watchpoint flags */
 #define BP_MEM_READ           0x01
 #define BP_MEM_WRITE          0x02

Modified: trunk/darwin-user/signal.c
===================================================================

darwin-user/signal.c +1 -1
@@ -215,7 +215,7 @@
 #endif
     if (queue_signal(sig, &tinfo) == 1) {
         /* interrupt the virtual CPU as soon as possible */
-        cpu_interrupt(global_env, CPU_INTERRUPT_EXIT);
+        cpu_exit(global_env);
     }
 }
 

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

exec.c +32 -24

89 lines not on this page · raw message

Modified: trunk/gdbstub.c
===================================================================

gdbstub.c +1 -1
@@ -2012,7 +2012,7 @@
 #ifdef CONFIG_USER_ONLY
     gdb_handlesig(s->c_cpu, 0);
 #else
-    cpu_interrupt(s->c_cpu, CPU_INTERRUPT_EXIT);
+    cpu_exit(s->c_cpu);
 #endif
 }
 

Modified: trunk/hw/dma.c
===================================================================

hw/dma.c +1 -1
@@ -449,7 +449,7 @@
 {
     CPUState *env = cpu_single_env;
     if (env)
-        cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+        cpu_exit(env);
 }
 
 static void dma_reset(void *opaque)

Modified: trunk/hw/mac_dbdma.c
===================================================================

hw/mac_dbdma.c +1 -1
@@ -653,7 +653,7 @@
 {
     CPUState *env = cpu_single_env;
     if (env)
-        cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+        cpu_exit(env);
 }
 
 static void

Modified: trunk/linux-user/main.c
===================================================================

linux-user/main.c +1 -1
@@ -200,7 +200,7 @@
     for (other = first_cpu; other; other = other->next_cpu) {
         if (other->running) {
             pending_cpus++;
-            cpu_interrupt(other, CPU_INTERRUPT_EXIT);
+            cpu_exit(other);
         }
     }
     if (pending_cpus > 1) {

Modified: trunk/linux-user/signal.c
===================================================================

linux-user/signal.c +1 -1
@@ -460,7 +460,7 @@
     host_to_target_siginfo_noswap(&tinfo, info);
     if (queue_signal(thread_env, sig, &tinfo) == 1) {
         /* interrupt the virtual CPU as soon as possible */
-        cpu_interrupt(thread_env, CPU_INTERRUPT_EXIT);
+        cpu_exit(thread_env);
     }
 }
 

Modified: trunk/vl.c
===================================================================

vl.c +7 -7
@@ -1181,7 +1181,7 @@
         }
         /* Interrupt execution to force deadline recalculation.  */
         if (use_icount && cpu_single_env) {
-            cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
+            cpu_exit(cpu_single_env);
         }
     }
 }
@@ -1348,7 +1348,7 @@
 
         if (env) {
             /* stop the currently executing cpu because a timer occured */
-            cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+            cpu_exit(env);
 #ifdef USE_KQEMU
             if (env->kqemu_enabled) {
                 kqemu_cpu_interrupt(env);
@@ -3326,7 +3326,7 @@
 {
     CPUState *env = cpu_single_env;
     if (env) {
-        cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+        cpu_exit(env);
 #ifdef USE_KQEMU
         if (env->kqemu_enabled) {
             kqemu_cpu_interrupt(env);
@@ -3407,7 +3407,7 @@
     bh->idle = 0;
     /* stop the currently executing CPU to execute the BH ASAP */
     if (env) {
-        cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+        cpu_exit(env);
     }
 }
 
@@ -3618,21 +3618,21 @@
         reset_requested = 1;
     }
     if (cpu_single_env)
-        cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
+        cpu_exit(cpu_single_env);
 }
 
 void qemu_system_shutdown_request(void)
 {
     shutdown_requested = 1;
     if (cpu_single_env)
-        cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
+        cpu_exit(cpu_single_env);
 }
 
 void qemu_system_powerdown_request(void)
 {
     powerdown_requested = 1;
     if (cpu_single_env)
-        cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT);
+        cpu_exit(cpu_single_env);
 }
 
 #ifdef _WIN32