File tree Expand file tree Collapse file tree 1 file changed +27
-36
lines changed
Expand file tree Collapse file tree 1 file changed +27
-36
lines changed Original file line number Diff line number Diff line change 11//! mie register
22
3- /// mie register
4- # [ derive ( Clone , Copy , Debug ) ]
5- pub struct Mie {
6- bits : usize ,
3+ read_write_csr ! {
4+ /// `mie` register
5+ Mie : 0x304 ,
6+ mask : 0xaaa ,
77}
88
9- impl Mie {
10- /// Returns the contents of the register as raw bits
11- #[ inline]
12- pub fn bits ( & self ) -> usize {
13- self . bits
14- }
15-
9+ read_write_csr_field ! {
10+ Mie ,
1611 /// Supervisor Software Interrupt Enable
17- #[ inline]
18- pub fn ssoft ( & self ) -> bool {
19- self . bits & ( 1 << 1 ) != 0
20- }
12+ ssoft: 1 ,
13+ }
2114
15+ read_write_csr_field ! {
16+ Mie ,
2217 /// Machine Software Interrupt Enable
23- #[ inline]
24- pub fn msoft ( & self ) -> bool {
25- self . bits & ( 1 << 3 ) != 0
26- }
18+ msoft: 3 ,
19+ }
2720
21+ read_write_csr_field ! {
22+ Mie ,
2823 /// Supervisor Timer Interrupt Enable
29- #[ inline]
30- pub fn stimer ( & self ) -> bool {
31- self . bits & ( 1 << 5 ) != 0
32- }
24+ stimer: 5 ,
25+ }
3326
27+ read_write_csr_field ! {
28+ Mie ,
3429 /// Machine Timer Interrupt Enable
35- #[ inline]
36- pub fn mtimer ( & self ) -> bool {
37- self . bits & ( 1 << 7 ) != 0
38- }
30+ mtimer: 7 ,
31+ }
3932
33+ read_write_csr_field ! {
34+ Mie ,
4035 /// Supervisor External Interrupt Enable
41- #[ inline]
42- pub fn sext ( & self ) -> bool {
43- self . bits & ( 1 << 9 ) != 0
44- }
36+ sext: 9 ,
37+ }
4538
39+ read_write_csr_field ! {
40+ Mie ,
4641 /// Machine External Interrupt Enable
47- #[ inline]
48- pub fn mext ( & self ) -> bool {
49- self . bits & ( 1 << 11 ) != 0
50- }
42+ mext: 11 ,
5143}
5244
53- read_csr_as ! ( Mie , 0x304 ) ;
5445set ! ( 0x304 ) ;
5546clear ! ( 0x304 ) ;
5647
You can’t perform that action at this time.
0 commit comments