diff options
-rw-r--r-- | hw/sun4u.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/hw/sun4u.c b/hw/sun4u.c index 237e20c1bf..50bc0d2e57 100644 --- a/hw/sun4u.c +++ b/hw/sun4u.c @@ -309,19 +309,22 @@ static void cpu_set_ivec_irq(void *opaque, int irq, int level) CPUSPARCState *env = opaque; if (level) { - CPUIRQ_DPRINTF("Raise IVEC IRQ %d\n", irq); - env->interrupt_index = TT_IVEC; - env->pil_in |= 1 << 5; - env->ivec_status |= 0x20; - env->ivec_data[0] = (0x1f << 6) | irq; - env->ivec_data[1] = 0; - env->ivec_data[2] = 0; - cpu_interrupt(env, CPU_INTERRUPT_HARD); - } else { - CPUIRQ_DPRINTF("Lower IVEC IRQ %d\n", irq); - env->pil_in &= ~(1 << 5); - env->ivec_status &= ~0x20; - cpu_reset_interrupt(env, CPU_INTERRUPT_HARD); + if (!(env->ivec_status & 0x20)) { + CPUIRQ_DPRINTF("Raise IVEC IRQ %d\n", irq); + env->halted = 0; + env->interrupt_index = TT_IVEC; + env->ivec_status |= 0x20; + env->ivec_data[0] = (0x1f << 6) | irq; + env->ivec_data[1] = 0; + env->ivec_data[2] = 0; + cpu_interrupt(env, CPU_INTERRUPT_HARD); + } + } else { + if (env->ivec_status & 0x20) { + CPUIRQ_DPRINTF("Lower IVEC IRQ %d\n", irq); + env->ivec_status &= ~0x20; + cpu_reset_interrupt(env, CPU_INTERRUPT_HARD); + } } } |