- Keep interrupts mask intact by RESTORE_CPU in MipsKernGenException

trap() function re-enables interrupts if exception happened with
    interrupts enabled and therefor status register might be modified
    by interrupt filters
This commit is contained in:
Oleksandr Tymoshenko 2009-06-19 19:02:40 +00:00
parent d7766b4586
commit e3ebc7a32e

View File

@ -389,6 +389,19 @@ NNON_LEAF(MipsKernGenException, KERN_EXC_FRAME_SIZE, ra)
jalr k0
sw a3, STAND_RA_OFFSET + KERN_REG_SIZE(sp) # for debugging
/*
* Update interrupt mask in saved status register
* Some of interrupts could be disabled by
* intr filters if interrupts are enabled later
* in trap handler
*/
mfc0 a0, COP_0_STATUS_REG
mtc0 zero, COP_0_STATUS_REG
and a0, a0, SR_INT_MASK
RESTORE_REG(a1, SR, sp)
and a1, a1, ~SR_INT_MASK
or a1, a1, a0
SAVE_REG(a1, SR, sp)
RESTORE_CPU # v0 contains the return address.
sync
eret