]> git.proxmox.com Git - qemu.git/commitdiff
Add missing cpu_halted function, by Magnus Damm.
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 22 Jun 2007 10:11:48 +0000 (10:11 +0000)
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
Fri, 22 Jun 2007 10:11:48 +0000 (10:11 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2998 c046a42c-6fe2-441c-8c8c-71466251a162

target-sh4/cpu.h
target-sh4/exec.h

index 00ee062680467de05378c5014edc8b8717240e9d..4f25b6cafa711191cb041da5b6dc433e4a93bc4b 100644 (file)
@@ -114,6 +114,7 @@ typedef struct CPUSH4State {
     jmp_buf jmp_env;
     int user_mode_only;
     int interrupt_request;
+    int halted;
     int exception_index;
      CPU_COMMON tlb_t utlb[UTLB_SIZE]; /* unified translation table */
     tlb_t itlb[ITLB_SIZE];     /* instruction translation table */
index 356330030770ed40b05202ef9f88e0c7db548b3a..84f29319e25c3d80d157121a6d7574b3b7238a6d 100644 (file)
@@ -36,6 +36,16 @@ register uint32_t T1 asm(AREG2);
 #include "cpu.h"
 #include "exec-all.h"
 
+static inline int cpu_halted(CPUState *env) {
+    if (!env->halted)
+        return 0;
+    if (env->interrupt_request & CPU_INTERRUPT_HARD) {
+        env->halted = 0;
+        return 0;
+    }
+    return EXCP_HALTED;
+}
+
 #ifndef CONFIG_USER_ONLY
 #include "softmmu_exec.h"
 #endif