r3500 - trunk/src/host/qemu-neo1973

andrew at sita.openmoko.org andrew at sita.openmoko.org
Fri Nov 23 23:32:14 CET 2007


Author: andrew
Date: 2007-11-23 23:31:57 +0100 (Fri, 23 Nov 2007)
New Revision: 3500

Modified:
   trunk/src/host/qemu-neo1973/cpu-all.h
   trunk/src/host/qemu-neo1973/cpu-exec.c
   trunk/src/host/qemu-neo1973/exec.c
   trunk/src/host/qemu-neo1973/vl.c
Log:
Changes missing from previous commit due to svn vs. git mutual hate.


Modified: trunk/src/host/qemu-neo1973/cpu-all.h
===================================================================
--- trunk/src/host/qemu-neo1973/cpu-all.h	2007-11-23 22:27:37 UTC (rev 3499)
+++ trunk/src/host/qemu-neo1973/cpu-all.h	2007-11-23 22:31:57 UTC (rev 3500)
@@ -706,6 +706,7 @@
     __attribute__ ((__noreturn__));
 extern CPUState *first_cpu;
 extern CPUState *cpu_single_env;
+extern int env_pending_request;
 extern int code_copy_enabled;
 
 #define CPU_INTERRUPT_EXIT   0x01 /* wants exit from main loop */

Modified: trunk/src/host/qemu-neo1973/cpu-exec.c
===================================================================
--- trunk/src/host/qemu-neo1973/cpu-exec.c	2007-11-23 22:27:37 UTC (rev 3499)
+++ trunk/src/host/qemu-neo1973/cpu-exec.c	2007-11-23 22:31:57 UTC (rev 3500)
@@ -258,6 +258,11 @@
 
     cpu_single_env = env1;
 
+    if (env_pending_request) {
+        cpu_interrupt(env1, env_pending_request);
+        env_pending_request = 0;
+    }
+
     /* first we save global registers */
 #define SAVE_HOST_REGS 1
 #include "hostregs_helper.h"

Modified: trunk/src/host/qemu-neo1973/exec.c
===================================================================
--- trunk/src/host/qemu-neo1973/exec.c	2007-11-23 22:27:37 UTC (rev 3499)
+++ trunk/src/host/qemu-neo1973/exec.c	2007-11-23 22:31:57 UTC (rev 3500)
@@ -96,6 +96,7 @@
 /* current CPU in the current thread. It is only valid inside
    cpu_exec() */
 CPUState *cpu_single_env;
+int env_pending_request;
 
 typedef struct PageDesc {
     /* list of TBs intersecting this ram page */
@@ -1194,6 +1195,12 @@
     TranslationBlock *tb;
     static int interrupt_lock;
 
+    /* cause an interrupt in the first cpu that tries to start running */
+    if (!env) {
+        env_pending_request |= mask;
+        return;
+    }
+
     env->interrupt_request |= mask;
     /* if the cpu is currently executing code, we must unlink it and
        all the potentially executing TB */

Modified: trunk/src/host/qemu-neo1973/vl.c
===================================================================
--- trunk/src/host/qemu-neo1973/vl.c	2007-11-23 22:27:37 UTC (rev 3499)
+++ trunk/src/host/qemu-neo1973/vl.c	2007-11-23 22:31:57 UTC (rev 3500)
@@ -1184,15 +1184,14 @@
         SetEvent(data->host_alarm);
 #endif
         CPUState *env = cpu_single_env;
-        if (env) {
-            /* stop the currently executing cpu because a timer occured */
-            cpu_interrupt(env, CPU_INTERRUPT_EXIT);
+
+        /* stop the currently executing cpu because a timer occured */
+        cpu_interrupt(env, CPU_INTERRUPT_EXIT);
 #ifdef USE_KQEMU
-            if (env->kqemu_enabled) {
-                kqemu_cpu_interrupt(env);
-            }
-#endif
+        if (env && env->kqemu_enabled) {
+            kqemu_cpu_interrupt(env);
         }
+#endif
     }
 }
 





More information about the commitlog mailing list