fix interrupt enable/disable macros
This commit is contained in:
parent
a90005a79e
commit
8aab789a24
1 changed files with 11 additions and 4 deletions
|
@ -1,15 +1,22 @@
|
||||||
macro EnableInt() {
|
macro EnableInt() {
|
||||||
lli t0, 0xAAA
|
lli t0, MI_INTR_MASK_ALL_SET
|
||||||
lli t1, 0xFF01
|
|
||||||
lui a0, MI_BASE
|
lui a0, MI_BASE
|
||||||
sw t0, MI_INTR_MASK(a0)
|
sw t0, MI_INTR_MASK(a0)
|
||||||
|
// careful not to touch unrelated flags here
|
||||||
|
mfc0 t1, CP0_Status
|
||||||
|
lli t0, CP0_STATUS_IM_ALL
|
||||||
|
or t1, t0
|
||||||
mtc0 t1, CP0_Status
|
mtc0 t1, CP0_Status
|
||||||
}
|
}
|
||||||
|
|
||||||
macro DisableInt() {
|
macro DisableInt() {
|
||||||
lli t0, 0x555
|
lli t0, MI_INTR_MASK_ALL_CLR
|
||||||
lli t1, 0x0001
|
|
||||||
lui a0, MI_BASE
|
lui a0, MI_BASE
|
||||||
sw t0, MI_INTR_MASK(a0)
|
sw t0, MI_INTR_MASK(a0)
|
||||||
|
// careful not to touch unrelated flags here
|
||||||
|
mfc0 t1, CP0_Status
|
||||||
|
lli t0, CP0_STATUS_IM_ALL
|
||||||
|
nor t0, r0 // invert the mask (including upper halfword)
|
||||||
|
and t1, t0
|
||||||
mtc0 t1, CP0_Status
|
mtc0 t1, CP0_Status
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue