Skip to content

Commit b3c100a

Browse files
author
David Reiss
committed
Implement Mstatus.bits()
1 parent 399c598 commit b3c100a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

riscv/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Added
1111

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

1415
### Fixed
1516

riscv/src/register/mstatus.rs

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ impl From<bool> for Endianness {
6565
}
6666

6767
impl Mstatus {
68+
/// Returns the contents of the register as raw bits
69+
#[inline]
70+
pub fn bits(&self) -> usize {
71+
self.bits
72+
}
73+
6874
/// Supervisor Interrupt Enable
6975
#[inline]
7076
pub fn sie(&self) -> bool {

0 commit comments

Comments
 (0)