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