Skip to content

Commit 3849dd5

Browse files
committed
riscv: add mseccfgh register
Adds the `mseccfgh` machine security configuration (high-bits) CSR.
1 parent e3dcd0b commit 3849dd5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

riscv/src/register.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ pub use self::mhpmeventx::*;
114114
// Machine configuration
115115
pub mod mconfigptr;
116116
pub mod mseccfg;
117+
#[cfg(any(test, target_arch = "riscv32"))]
118+
pub mod mseccfgh;
117119

118120
#[cfg(test)]
119121
mod tests;

riscv/src/register/mseccfgh.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//! mseccfgh register
2+
3+
use super::mseccfg::PMM;
4+
5+
read_write_csr! {
6+
/// mseccfgh register
7+
Mseccfgh: 0x757,
8+
mask: 0x3,
9+
}
10+
11+
read_write_csr_field! {
12+
Mseccfgh,
13+
/// Pointer Masking Machine-mode
14+
///
15+
/// # Note
16+
///
17+
/// Defined in in the [Smmpm](https://github.com/riscv/riscv-j-extension/releases/download/pointer-masking-ratified/pointer-masking-ratified.pdf) extension.
18+
pmm,
19+
PMM: [0:1],
20+
}

0 commit comments

Comments
 (0)