diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-30 16:44:54 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-30 16:44:54 +0000 |
commit | 24c7b0e330fdbfcfe87f515d79e67156c57cbc4f (patch) | |
tree | 50ed71bd4fc4c3fc0e6fc5cccb222417244b5baa /hw | |
parent | e69f67b6d58f366ffaa83a0973948edd1f74b370 (diff) |
Sanitize mips exception handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2546 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/mips_int.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/hw/mips_int.c b/hw/mips_int.c index 7f9f15305b..b384b64d28 100644 --- a/hw/mips_int.c +++ b/hw/mips_int.c @@ -5,17 +5,16 @@ IRQ may change */ void cpu_mips_update_irq(CPUState *env) { - if ((env->CP0_Status & env->CP0_Cause & CP0Ca_IP_mask) && - (env->CP0_Status & (1 << CP0St_IE)) && - !(env->hflags & MIPS_HFLAG_EXL) && - !(env->hflags & MIPS_HFLAG_ERL) && - !(env->hflags & MIPS_HFLAG_DM)) { - if (! (env->interrupt_request & CPU_INTERRUPT_HARD)) { + if ((env->CP0_Status & (1 << CP0St_IE)) && + !(env->CP0_Status & (1 << CP0St_EXL)) && + !(env->CP0_Status & (1 << CP0St_ERL)) && + !(env->hflags & MIPS_HFLAG_DM)) { + if ((env->CP0_Status & env->CP0_Cause & CP0Ca_IP_mask) && + !(env->interrupt_request & CPU_INTERRUPT_HARD)) { cpu_interrupt(env, CPU_INTERRUPT_HARD); } - } else { + } else cpu_reset_interrupt(env, CPU_INTERRUPT_HARD); - } } void cpu_mips_irq_request(void *opaque, int irq, int level) |