After setting mstatus.MIE in the timerinit() function in start.c, it seems that there is no situation between when mstatus.MIE is set and asm volatile("mret") where global interrupts needing to be used in M-mode are required.
And after mret enters S-mode, mstatus.MIE will be replaced by mstatus.MPIE, which is 0. Additionally, due to the design of RISC-V, in lower privilege levels, regardless of the value of mstatus.MIE, interrupts in M-mode are always enabled.
I am curious if there is any special consideration for setting mstatus.MIE in this case?
After setting
mstatus.MIE
in thetimerinit()
function instart.c
, it seems that there is no situation between whenmstatus.MIE
is set andasm volatile("mret")
where global interrupts needing to be used in M-mode are required. And aftermret
enters S-mode,mstatus.MIE
will be replaced bymstatus.MPIE
, which is 0. Additionally, due to the design of RISC-V, in lower privilege levels, regardless of the value ofmstatus.MIE
, interrupts in M-mode are always enabled. I am curious if there is any special consideration for settingmstatus.MIE
in this case?