File tree Expand file tree Collapse file tree 2 files changed +6
-25
lines changed Expand file tree Collapse file tree 2 files changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
20
20
- Use CSR helper macros to define ` mideleg ` register
21
21
- Use CSR helper macros to define ` mcounteren ` register
22
22
- Use CSR helper macros to define ` mie ` register
23
+ - Use CSR helper macros to define ` mimpid ` register
23
24
24
25
## [ v0.12.1] - 2024-10-20
25
26
Original file line number Diff line number Diff line change 1
1
//! mimpid register
2
2
3
- use core:: num:: NonZeroUsize ;
4
-
5
- /// mimpid register
6
- #[ derive( Clone , Copy , Debug ) ]
7
- pub struct Mimpid {
8
- bits : NonZeroUsize ,
9
- }
10
-
11
- impl Mimpid {
12
- /// Returns the contents of the register as raw bits
13
- #[ inline]
14
- pub fn bits ( & self ) -> usize {
15
- self . bits . get ( )
16
- }
17
- }
18
-
19
- read_csr ! ( 0xF13 ) ;
20
-
21
- /// Reads the CSR
22
- #[ inline]
23
- pub fn read ( ) -> Option < Mimpid > {
24
- let r = unsafe { _read ( ) } ;
25
- // When mimpid is hardwired to zero it means that the mimpid
26
- // csr isn't implemented.
27
- NonZeroUsize :: new ( r) . map ( |bits| Mimpid { bits } )
3
+ read_only_csr ! {
4
+ /// `mimpid` register
5
+ Mimpid : 0xF13 ,
6
+ mask: 0xffff_ffff ,
7
+ sentinel: 0 ,
28
8
}
You can’t perform that action at this time.
0 commit comments