Skip to content

Commit 5cf94a9

Browse files
committed
feat(riscv): add sireg CSR
1 parent fa12baa commit 5cf94a9

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

riscv/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Added
1111

12+
- Add `sireg` CSR
1213
- Auto-generate `<FIELD>_SHIFT`, `<FIELD>_WIDTH`, and `<FIELD>_MASK` associated
1314
constants on CSR types for every bitfield defined via the `read_write_csr_field!`
1415
and `read_only_csr_field!` macros, giving downstream code a single source of

riscv/src/register.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ pub mod mseccfgh;
128128
pub mod miselect;
129129

130130
// Supervisor indirect access
131+
pub mod sireg;
131132
pub mod siselect;
132133

133134
// Virtual supervisor indirect access

riscv/src/register/sireg.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//! 'sireg' register (Supervisor Indirect Register Alias)
2+
//!
3+
//! CSR address: 0x151
4+
//!
5+
//! The `sireg` register provides access to an indirect register
6+
//! selected by `siselect`.
7+
8+
const MASK: usize = usize::MAX;
9+
10+
read_write_csr! {
11+
/// `sireg` register.
12+
Sireg: 0x151,
13+
mask: MASK
14+
}

0 commit comments

Comments
 (0)