Skip to content

Commit 7a8d3d1

Browse files
committed
Implement mscratch and mtval registers
1 parent 00367d4 commit 7a8d3d1

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/register/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ pub mod mtvec;
6767

6868

6969
// Machine Trap Handling
70-
// TODO: mscratch
70+
pub mod mscratch;
7171
pub mod mepc;
7272
pub mod mcause;
73-
// TODO: mtval
73+
pub mod mtval;
7474
pub mod mip;
7575

7676

src/register/mscratch.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//! mscratch register
2+
3+
read_csr_as_usize!(0x340, __read_mscratch);
4+
write_csr_as_usize!(0x340, __write_mscratch);

src/register/mtval.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//! mtval register
2+
3+
read_csr_as_usize!(0x343, __read_mtval);

0 commit comments

Comments
 (0)