File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,9 @@ pub mod mseccfg;
117
117
#[ cfg( any( test, target_arch = "riscv32" ) ) ]
118
118
pub mod mseccfgh;
119
119
120
+ // Machine indirect access
121
+ pub mod miselect;
122
+
120
123
#[ cfg( test) ]
121
124
mod tests;
122
125
Original file line number Diff line number Diff line change
1
+ //! `miselect` register.
2
+
3
+ const MASK : usize = usize:: MAX ;
4
+
5
+ read_write_csr ! {
6
+ /// `miselect` register.
7
+ Miselect : 0x350 ,
8
+ mask: MASK ,
9
+ }
10
+
11
+ #[ cfg( target_arch = "riscv32" ) ]
12
+ read_write_csr_field ! {
13
+ Miselect ,
14
+ /// Returns whether `miselect` is for custom use of indirect CSRs.
15
+ is_custom: 31 ,
16
+ }
17
+
18
+ #[ cfg( not( target_arch = "riscv32" ) ) ]
19
+ read_write_csr_field ! {
20
+ Miselect ,
21
+ /// Returns whether `miselect` is for custom use of indirect CSRs.
22
+ is_custom: 63 ,
23
+ }
24
+
25
+ #[ cfg( target_arch = "riscv32" ) ]
26
+ read_write_csr_field ! {
27
+ Miselect ,
28
+ /// Gets the value stored in the `miselect` CSR.
29
+ ///
30
+ /// # Note
31
+ ///
32
+ /// The semantics of the value depend on the extension for the referenced CSR,
33
+ /// and the relevant `mireg*` value.
34
+ value: [ 0 : 30 ] ,
35
+ }
36
+
37
+ #[ cfg( not( target_arch = "riscv32" ) ) ]
38
+ read_write_csr_field ! {
39
+ Miselect ,
40
+ /// Gets the value stored in the `miselect` CSR.
41
+ ///
42
+ /// # Note
43
+ ///
44
+ /// The semantics of the value depend on the extension for the referenced CSR,
45
+ /// and the relevant `mireg*` value.
46
+ value: [ 0 : 62 ] ,
47
+ }
You can’t perform that action at this time.
0 commit comments