Skip to content

Commit

Permalink
Implement Mstatus.bits()
Browse files Browse the repository at this point in the history
  • Loading branch information
David Reiss committed Mar 27, 2024
1 parent 399c598 commit b3c100a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions riscv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added

- Add `Mcause::from(usize)` for use in unit tests
- Add `Mstatus.bits()`

### Fixed

Expand Down
6 changes: 6 additions & 0 deletions riscv/src/register/mstatus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ impl From<bool> for Endianness {
}

impl Mstatus {
/// Returns the contents of the register as raw bits
#[inline]
pub fn bits(&self) -> usize {
self.bits
}

/// Supervisor Interrupt Enable
#[inline]
pub fn sie(&self) -> bool {
Expand Down

0 comments on commit b3c100a

Please sign in to comment.