riscv: fix mstatus/sstatus helpers and field mask#396
riscv: fix mstatus/sstatus helpers and field mask#396elliott10 wants to merge 2 commits intorust-embedded:masterfrom
Conversation
|
I will need some time to review this PR. Can you share with me the link to the ISA specification you used for these modifications? I usually use this: https://docs.riscv.org/reference/isa/_attachments/riscv-privileged.pdf There is a new release (from February) and looks like there is a few more fields |
I referred to this ISA Spec: https://docs.riscv.org/reference/isa/priv/supervisor.html#sstatus If there is anything I have missed, I am willing to keep improving it :) |
romancardenas
left a comment
There was a problem hiding this comment.
Looks good to me!! Please, address the changes in CHANGELOG.md and the minor docs formatting comment.
| /// | ||
| /// Encodes the status of additional user-mode extensions and associated | ||
| /// state. | ||
| /// state. This is a read-only field summarizing the status of all |
There was a problem hiding this comment.
| /// state. This is a read-only field summarizing the status of all | |
| /// state. | |
| /// | |
| /// This is a read-only field summarizing the status of all |
| ### | ||
| - Add `mstatus` and `sstatus` CSRs helpers for UBE, VS, UXL and SXL/SBE/MBE where applicable | ||
| model XS and SD as read-only summary fields instead of writable fields | ||
| - Fix the CSR masks to preserve all legal status bits | ||
|
|
||
| ### Added | ||
|
|
There was a problem hiding this comment.
Move the additions to the Added section:
| ### | |
| - Add `mstatus` and `sstatus` CSRs helpers for UBE, VS, UXL and SXL/SBE/MBE where applicable | |
| model XS and SD as read-only summary fields instead of writable fields | |
| - Fix the CSR masks to preserve all legal status bits | |
| ### Added | |
| ### Added | |
| - - Add `mstatus` and `sstatus` CSRs helpers for UBE, VS, UXL and SXL/SBE/MBE where applicable | |
| model XS and SD as read-only summary fields instead of writable fields | |
| - Add `pmpaddr16` ~ `pmpaddr63` CSRs |
And the changes to the Changed section:
### Changed (section below Added)
- Fix the CSR masks to preserve all legal status bits
- ...
riscv: complete mstatus and sstatus status helpers
Align the mstatus and sstatus helpers with the privileged spec.