Implement mscratch and mtval registers

This commit is contained in:
Vadim Kaushan 2019-06-25 23:48:27 +03:00
parent 00367d4fd2
commit 7a8d3d1f6c
No known key found for this signature in database
GPG Key ID: A501C5DF67C05C4E
3 changed files with 9 additions and 2 deletions

View File

@ -67,10 +67,10 @@ pub mod mtvec;
// Machine Trap Handling // Machine Trap Handling
// TODO: mscratch pub mod mscratch;
pub mod mepc; pub mod mepc;
pub mod mcause; pub mod mcause;
// TODO: mtval pub mod mtval;
pub mod mip; pub mod mip;

4
src/register/mscratch.rs Normal file
View File

@ -0,0 +1,4 @@
//! mscratch register
read_csr_as_usize!(0x340, __read_mscratch);
write_csr_as_usize!(0x340, __write_mscratch);

3
src/register/mtval.rs Normal file
View File

@ -0,0 +1,3 @@
//! mtval register
read_csr_as_usize!(0x343, __read_mtval);