Skip to content

Conversation

jwnhy
Copy link
Contributor

@jwnhy jwnhy commented Mar 3, 2022

This is a rework of #77. In #77, there is detailed explaination about why this is needed.
I have taken advices that we should add a new type to store values of registers like mstatus.
So I added MstatusBuilder and MstatusValue to resolve this issue.

  • MstatusBuilder contains a set of setters that can construct a value for mstatus register.
  • MstatusValue is only able to write to the physical register and take effect.

As this is a rather big change, I plan to open this PR as a request for comments.

If this style is okay, I will work in a few days implementing and documenting for other registers.

Thanks in advance for your valuable comments.

@jwnhy jwnhy requested a review from a team as a code owner March 3, 2022 16:20
@jwnhy
Copy link
Contributor Author

jwnhy commented Mar 4, 2022

I am thinking that for common registers, just setter and getter should suffice.
For complicated register like pmpcfg, a more approachable config function should be provided?

@jwnhy jwnhy changed the base branch from master to staging March 5, 2022 04:16
@jwnhy
Copy link
Contributor Author

jwnhy commented Mar 5, 2022

Move to staging as there are quite a lot changes.

romancardenas pushed a commit that referenced this pull request Nov 17, 2023
98: Convert default_setup_interrupts into a Rust function r=dkhayes117 a=Disasm

First step towards a fully inline-asm `riscv-rt`.

Co-authored-by: Vadim Kaushan <[email protected]>
@jwnhy jwnhy closed this Sep 11, 2024
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

Successfully merging this pull request may close these issues.

1 participant