diff options
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/exec.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/target-i386/exec.h b/target-i386/exec.h index b51667a1f6..fbaf5bc984 100644 --- a/target-i386/exec.h +++ b/target-i386/exec.h @@ -338,14 +338,23 @@ static inline void regs_to_env(void) #endif } +static inline int cpu_has_work(CPUState *env) +{ + int work; + + work = (env->interrupt_request & CPU_INTERRUPT_HARD) && + (env->eflags & IF_MASK); + work |= env->interrupt_request & CPU_INTERRUPT_NMI; + + return work; +} + static inline int cpu_halted(CPUState *env) { /* handle exit of HALTED state */ if (!env->halted) return 0; /* disable halt condition */ - if (((env->interrupt_request & CPU_INTERRUPT_HARD) && - (env->eflags & IF_MASK)) || - (env->interrupt_request & CPU_INTERRUPT_NMI)) { + if (cpu_has_work(env)) { env->halted = 0; return 0; } |