]> git.proxmox.com Git - qemu.git/blobdiff - target-i386/exec.h
Clean up of some target specifics in exec.c/cpu-exec.c.
[qemu.git] / target-i386 / exec.h
index 377f7bd28b953c43b03192defbfe47fe1b9d43e9..f1cf2b9234acdf7a650dd413cfdf5dc07e19bf50 100644 (file)
@@ -575,3 +575,16 @@ static inline void regs_to_env(void)
     env->regs[R_EDI] = EDI;
 #endif
 }
+
+static inline int cpu_halted(CPUState *env) {
+    /* handle exit of HALTED state */
+    if (env->hflags & HF_HALTED_MASK)
+        return 0;
+    /* disable halt condition */
+    if ((env->interrupt_request & CPU_INTERRUPT_HARD) &&
+        (env->eflags & IF_MASK)) {
+        env->hflags &= ~HF_HALTED_MASK;
+        return 0;
+    }
+    return EXCP_HALTED;
+}