Skip to content

Commit

Permalink
Fix disabling interrupts in sun4u
Browse files Browse the repository at this point in the history
clear interrupt request if the interrupt priority < CPU pil
clear hardware interrupt request if interrupts are disabled

Signed-off-by: Artyom Tarasenko <[email protected]>
[[email protected]: added a comment about magic 2]
Signed-off-by: Blue Swirl <[email protected]>
  • Loading branch information
artyom-tarasenko authored and blueswirl committed Aug 28, 2011
1 parent 010f3f5 commit 9f94778
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hw/sun4u.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ void cpu_check_irqs(CPUState *env)
pil |= 1 << 14;
}

if (!pil) {
/* The bit corresponding to psrpil is (1<< psrpil), the next bit
is (2 << psrpil). */
if (pil < (2 << env->psrpil)){
if (env->interrupt_request & CPU_INTERRUPT_HARD) {
CPUIRQ_DPRINTF("Reset CPU IRQ (current interrupt %x)\n",
env->interrupt_index);
Expand Down Expand Up @@ -293,10 +295,12 @@ void cpu_check_irqs(CPUState *env)
break;
}
}
} else {
} else if (env->interrupt_request & CPU_INTERRUPT_HARD) {
CPUIRQ_DPRINTF("Interrupts disabled, pil=%08x pil_in=%08x softint=%08x "
"current interrupt %x\n",
pil, env->pil_in, env->softint, env->interrupt_index);
env->interrupt_index = 0;
cpu_reset_interrupt(env, CPU_INTERRUPT_HARD);
}
}

Expand Down

0 comments on commit 9f94778

Please sign in to comment.