进入中断,硬件自动禁用中断,出中断,自动开启中断,无需手动操作,删除对应的代码

This commit is contained in:
2025-02-03 13:12:05 +08:00
parent a5d2f7e947
commit 2dc822da1b
2 changed files with 31 additions and 1 deletions

View File

@@ -42,15 +42,17 @@ _prog_start:
.balign 32
_rv32i_plic_handle:
#if 0 /*RV32*/
csrr x16, mstatus # mstatus
andi x16, x16, ~(1 << 3) # MIE ()
csrw mstatus, x16 # mstatus
#endif
lw x23, 0(x17) # x23 = *plic_claim
sw x23, 0(x17) # *plic_claim = x23
#li x25, 1
#if 0
li x24, CDR_INT_TXEND
bne x23, x24, 1f #_if (x23 != x24) goto 1f
sw x25, 0(x18) #_else
@@ -72,9 +74,29 @@ _rv32i_plic_handle:
li x24, CDR_INT_RXEND
bne x23, x24, 4f #_if (x23 != x24) goto 4f
sw x25, 0(x21) #_else
#else
bne x23, x28, 1f #_if (x23 != x24) goto 1f
sw x25, 0(x18) #_else
j 4f
1:
bne x23, x29, 2f #_if (x23 != x24) goto 2f
sw x25, 0(x19) #_else
j 4f
2:
bne x23, x30, 3f #_if (x23 != x24) goto 3f
sw x25, 0(x20) #_else
j 4f
3:
bne x23, x31, 4f #_if (x23 != x24) goto 4f
sw x25, 0(x21) #_else
#endif
4:
#if 0 /*RV32*/
csrr x16, mstatus
ori x16, x16, 1<<3
csrw mstatus, x16
#endif
mret