File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ pub mod mcause;
88
88
pub mod mepc;
89
89
pub mod mip;
90
90
pub mod mscratch;
91
+ pub mod mtinst;
91
92
pub mod mtval;
92
93
93
94
// Machine Protection and Translation
Original file line number Diff line number Diff line change
1
+ //! mtinst register.
2
+
3
+ const MASK : usize = usize:: MAX ;
4
+
5
+ read_write_csr ! {
6
+ /// mtinst register
7
+ Mtinst : 0x34a ,
8
+ mask: MASK ,
9
+ }
10
+
11
+ read_write_csr_field ! {
12
+ Mtinst ,
13
+ /// Trapped instruction `opcode` field.
14
+ opcode: [ 0 : 6 ] ,
15
+ }
16
+
17
+ read_write_csr_field ! {
18
+ Mtinst ,
19
+ /// Trapped instruction `rd` field for load instructions.
20
+ rd: [ 7 : 11 ] ,
21
+ }
22
+
23
+ read_write_csr_field ! {
24
+ Mtinst ,
25
+ /// Trapped instruction `funct3` field.
26
+ funct3: [ 12 : 14 ] ,
27
+ }
28
+
29
+ read_write_csr_field ! {
30
+ Mtinst ,
31
+ /// Trapped instruction `address offset` field.
32
+ address_offset: [ 15 : 19 ] ,
33
+ }
34
+
35
+ read_write_csr_field ! {
36
+ Mtinst ,
37
+ /// Trapped instruction `rs2` field for store instructions.
38
+ rs2: [ 20 : 24 ] ,
39
+ }
40
+
41
+ read_write_csr_field ! {
42
+ Mtinst ,
43
+ /// Trapped instruction `rl` field for atomic instructions.
44
+ rl: 25 ,
45
+ }
46
+
47
+ read_write_csr_field ! {
48
+ Mtinst ,
49
+ /// Trapped instruction `aq` field for atomic instructions.
50
+ aq: 26 ,
51
+ }
52
+
53
+ read_write_csr_field ! {
54
+ Mtinst ,
55
+ /// Trapped instruction `funct5` field for atomic instructions.
56
+ funct5: [ 27 : 31 ] ,
57
+ }
58
+
59
+ read_write_csr_field ! {
60
+ Mtinst ,
61
+ /// Trapped instruction `funct7` field for virtual machine instructions.
62
+ funct7: [ 25 : 31 ] ,
63
+ }
64
+
65
+ set ! ( 0x34a ) ;
66
+ clear ! ( 0x34a ) ;
You can’t perform that action at this time.
0 commit comments