- 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:
parent
d7766b4586
commit
e3ebc7a32e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user