Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting mstatus.MIE in start.c seems meaningless. #187

Open
LiuJiLan opened this issue Jun 11, 2023 · 0 comments
Open

Setting mstatus.MIE in start.c seems meaningless. #187

LiuJiLan opened this issue Jun 11, 2023 · 0 comments

Comments

@LiuJiLan
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant