aboutsummaryrefslogtreecommitdiffstats
path: root/target-mips/exec.h
diff options
context:
space:
mode:
Diffstat (limited to 'target-mips/exec.h')
-rw-r--r--target-mips/exec.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/target-mips/exec.h b/target-mips/exec.h
index 8a118bb..0d55790 100644
--- a/target-mips/exec.h
+++ b/target-mips/exec.h
@@ -8,7 +8,7 @@
#include "dyngen-exec.h"
#include "cpu-defs.h"
-register struct CPUMIPSState *env asm(AREG0);
+GLOBAL_REGISTER_VARIABLE_DECL struct CPUMIPSState *env asm(AREG0);
#include "cpu.h"
#include "exec-all.h"
@@ -35,10 +35,22 @@ static inline void regs_to_env(void)
static inline int cpu_has_work(CPUState *env)
{
- return (env->interrupt_request &
- (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER));
-}
+ int has_work = 0;
+
+ /* It is implementation dependent if non-enabled interrupts
+ wake-up the CPU, however most of the implementations only
+ check for interrupts that can be taken. */
+ if ((env->interrupt_request & CPU_INTERRUPT_HARD) &&
+ cpu_mips_hw_interrupts_pending(env)) {
+ has_work = 1;
+ }
+ if (env->interrupt_request & CPU_INTERRUPT_TIMER) {
+ has_work = 1;
+ }
+
+ return has_work;
+}
static inline int cpu_halted(CPUState *env)
{