Skip to content

Commit 976b34c

Browse files
committed
riscv: make mcycle & minstret low bits writable
The RISC-V Instruction Set Manual Volume II: Privileged Architecture 20240411 specifies mcycle and minstret as "MRW" for read-write, instead of "MRO" for read-only.
1 parent 6b57558 commit 976b34c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

riscv/src/register/mcycle.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! mcycle register
22
33
read_csr_as_usize!(0xB00);
4+
write_csr_as_usize!(0xB00);
45
read_composite_csr!(super::mcycleh::read(), read());

riscv/src/register/minstret.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! minstret register
22
33
read_csr_as_usize!(0xB02);
4+
write_csr_as_usize!(0xB02);
45
read_composite_csr!(super::minstreth::read(), read());

0 commit comments

Comments
 (0)