From bfed01fc79cb2da1c6ca700bb0ce9238ce2974c7 Mon Sep 17 00:00:00 2001 From: ths Date: Sun, 3 Jun 2007 17:44:37 +0000 Subject: Clean up of some target specifics in exec.c/cpu-exec.c. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2936 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-i386/exec.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'target-i386/exec.h') diff --git a/target-i386/exec.h b/target-i386/exec.h index 377f7bd28b..f1cf2b9234 100644 --- a/target-i386/exec.h +++ b/target-i386/exec.h @@ -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; +} -- cgit v1.2.1