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/).
2020- Use CSR helper macros to define ` mideleg ` register
2121- Use CSR helper macros to define ` mcounteren ` register
2222- Use CSR helper macros to define ` mie ` register
23+ - Use CSR helper macros to define ` mimpid ` register
2324
2425## [ v0.12.1] - 2024-10-20
2526
Original file line number Diff line number Diff line change 11//! mimpid register
22
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 ,
288}
You can’t perform that action at this time.
0 commit comments