You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit removes manual mstatus bit manipulation and allows hardware
to manage interrupt enable state per RISC-V Privileged Spec §3.1.6.1.
The original code manually reconstructed mstatus.MIE from mstatus.MPIE
during context save, which violated the RISC-V specification. Hardware
automatically manages the MIE/MPIE stack during trap entry (mpie <- mie,
mie <- 0) and MRET (mie <- mpie, mpie <- 1), so manual intervention is
unnecessary and causes bugs with nested trap handling.
This fix ensures spec-compliant behavior, resolves nested interrupt
issues, and improves code clarity with 78% reduction in context save
instructions.
Close#16
0 commit comments