File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change 2
2
3
3
pub use super :: mstatus:: Endianness ;
4
4
5
- /// mstatus register
6
- # [ derive ( Clone , Copy , Debug ) ]
7
- pub struct Mstatush {
8
- bits : usize ,
5
+ read_write_csr ! {
6
+ /// mstatus register
7
+ Mstatush : 0x310 ,
8
+ mask : 0x30 ,
9
9
}
10
10
11
- impl Mstatush {
11
+ read_write_csr_field ! {
12
+ Mstatush ,
12
13
/// S-mode non-instruction-fetch memory endianness
13
- #[ inline]
14
- pub fn sbe ( & self ) -> Endianness {
15
- Endianness :: from ( self . bits & ( 1 << 4 ) != 0 )
16
- }
14
+ sbe,
15
+ Endianness : [ 4 : 4 ] ,
16
+ }
17
17
18
+ read_write_csr_field ! {
19
+ Mstatush ,
18
20
/// M-mode non-instruction-fetch memory endianness
19
- #[ inline]
20
- pub fn mbe ( & self ) -> Endianness {
21
- Endianness :: from ( self . bits & ( 1 << 5 ) != 0 )
22
- }
21
+ mbe,
22
+ Endianness : [ 5 : 5 ] ,
23
23
}
24
24
25
- read_csr_as_rv32 ! ( Mstatush , 0x310 ) ;
26
- write_csr_rv32 ! ( 0x310 ) ;
27
25
set_rv32 ! ( 0x310 ) ;
28
26
clear_rv32 ! ( 0x310 ) ;
29
27
You can’t perform that action at this time.
0 commit comments