Skip to content

Commit 75cf170

Browse files
bors[bot]jwnhy
andauthored
Merge #80
80: add support for mprv r=almindor a=jwnhy Co-authored-by: john <[email protected]> Co-authored-by: John Weston <[email protected]>
2 parents c49c675 + ec840e4 commit 75cf170

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/register/mstatus.rs

+9
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ impl Mstatus {
142142
}
143143
}
144144

145+
/// Modify Memory PRiVilege
146+
#[inline]
147+
pub fn mprv(&self) -> bool {
148+
self.bits.get_bit(17)
149+
}
150+
145151
/// Permit Supervisor User Memory access
146152
#[inline]
147153
pub fn sum(&self) -> bool {
@@ -226,6 +232,9 @@ set_csr!(
226232
set_csr!(
227233
/// Machine Previous Interrupt Enable
228234
, set_mpie, 1 << 7);
235+
set_clear_csr!(
236+
/// Modify Memory PRiVilege
237+
, set_mprv, clear_mprv, 1 << 17);
229238
set_clear_csr!(
230239
/// Permit Supervisor User Memory access
231240
, set_sum, clear_sum, 1 << 18);

0 commit comments

Comments
 (0)