@@ -31,39 +31,39 @@ impl ExceptionType {
31
31
#[ cfg( target_arch = "x86" ) ]
32
32
impl ExceptionType {
33
33
/// Divide-by-zero Error
34
- pub const EXCEPT_IA32_DIVIDE_ERROR : ExceptionType = ExceptionType ( 0 ) ;
34
+ pub const EXCEPT_IA32_DIVIDE_ERROR : Self = Self ( 0 ) ;
35
35
/// Debug Exception
36
- pub const EXCEPT_IA32_DEBUG : ExceptionType = ExceptionType ( 1 ) ;
36
+ pub const EXCEPT_IA32_DEBUG : Self = Self ( 1 ) ;
37
37
/// Non-maskable Interrupt
38
- pub const EXCEPT_IA32_NMI : ExceptionType = ExceptionType ( 2 ) ;
38
+ pub const EXCEPT_IA32_NMI : Self = Self ( 2 ) ;
39
39
/// Breakpoint
40
- pub const EXCEPT_IA32_BREAKPOINT : ExceptionType = ExceptionType ( 3 ) ;
40
+ pub const EXCEPT_IA32_BREAKPOINT : Self = Self ( 3 ) ;
41
41
/// Overflow
42
- pub const EXCEPT_IA32_OVERFLOW : ExceptionType = ExceptionType ( 4 ) ;
42
+ pub const EXCEPT_IA32_OVERFLOW : Self = Self ( 4 ) ;
43
43
/// Bound Range Exceeded
44
- pub const EXCEPT_IA32_BOUND : ExceptionType = ExceptionType ( 5 ) ;
44
+ pub const EXCEPT_IA32_BOUND : Self = Self ( 5 ) ;
45
45
/// Invalid Opcode
46
- pub const EXCEPT_IA32_INVALID_OPCODE : ExceptionType = ExceptionType ( 6 ) ;
46
+ pub const EXCEPT_IA32_INVALID_OPCODE : Self = Self ( 6 ) ;
47
47
/// Double Fault
48
- pub const EXCEPT_IA32_DOUBLE_FAULT : ExceptionType = ExceptionType ( 8 ) ;
48
+ pub const EXCEPT_IA32_DOUBLE_FAULT : Self = Self ( 8 ) ;
49
49
/// Invalid TSS
50
- pub const EXCEPT_IA32_INVALID_TSS : ExceptionType = ExceptionType ( 10 ) ;
50
+ pub const EXCEPT_IA32_INVALID_TSS : Self = Self ( 10 ) ;
51
51
/// Segment Not Present
52
- pub const EXCEPT_IA32_SEG_NOT_PRESENT : ExceptionType = ExceptionType ( 11 ) ;
52
+ pub const EXCEPT_IA32_SEG_NOT_PRESENT : Self = Self ( 11 ) ;
53
53
/// Stack-Segment Fault
54
- pub const EXCEPT_IA32_STACK_FAULT : ExceptionType = ExceptionType ( 12 ) ;
54
+ pub const EXCEPT_IA32_STACK_FAULT : Self = Self ( 12 ) ;
55
55
/// General Protection Fault
56
- pub const EXCEPT_IA32_GP_FAULT : ExceptionType = ExceptionType ( 13 ) ;
56
+ pub const EXCEPT_IA32_GP_FAULT : Self = Self ( 13 ) ;
57
57
/// Page Fault
58
- pub const EXCEPT_IA32_PAGE_FAULT : ExceptionType = ExceptionType ( 14 ) ;
58
+ pub const EXCEPT_IA32_PAGE_FAULT : Self = Self ( 14 ) ;
59
59
/// x87 Floating-Point Exception
60
- pub const EXCEPT_IA32_FP_ERROR : ExceptionType = ExceptionType ( 16 ) ;
60
+ pub const EXCEPT_IA32_FP_ERROR : Self = Self ( 16 ) ;
61
61
/// Alignment Check
62
- pub const EXCEPT_IA32_ALIGNMENT_CHECK : ExceptionType = ExceptionType ( 17 ) ;
62
+ pub const EXCEPT_IA32_ALIGNMENT_CHECK : Self = Self ( 17 ) ;
63
63
/// Machine Check
64
- pub const EXCEPT_IA32_MACHINE_CHECK : ExceptionType = ExceptionType ( 18 ) ;
64
+ pub const EXCEPT_IA32_MACHINE_CHECK : Self = Self ( 18 ) ;
65
65
/// SIMD Floating-Point Exception
66
- pub const EXCEPT_IA32_SIMD : ExceptionType = ExceptionType ( 19 ) ;
66
+ pub const EXCEPT_IA32_SIMD : Self = Self ( 19 ) ;
67
67
}
68
68
69
69
#[ cfg( target_arch = "x86_64" ) ]
@@ -107,80 +107,80 @@ impl ExceptionType {
107
107
#[ cfg( target_arch = "arm" ) ]
108
108
impl ExceptionType {
109
109
/// Processor reset
110
- pub const EXCEPT_ARM_RESET : ExceptionType = ExceptionType ( 0 ) ;
110
+ pub const EXCEPT_ARM_RESET : Self = Self ( 0 ) ;
111
111
/// Undefined instruction
112
- pub const EXCEPT_ARM_UNDEFINED_INSTRUCTION : ExceptionType = ExceptionType ( 1 ) ;
112
+ pub const EXCEPT_ARM_UNDEFINED_INSTRUCTION : Self = Self ( 1 ) ;
113
113
/// Software Interrupt
114
- pub const EXCEPT_ARM_SOFTWARE_INTERRUPT : ExceptionType = ExceptionType ( 2 ) ;
114
+ pub const EXCEPT_ARM_SOFTWARE_INTERRUPT : Self = Self ( 2 ) ;
115
115
/// Prefetch aborted
116
- pub const EXCEPT_ARM_PREFETCH_ABORT : ExceptionType = ExceptionType ( 3 ) ;
116
+ pub const EXCEPT_ARM_PREFETCH_ABORT : Self = Self ( 3 ) ;
117
117
/// Data access memory abort
118
- pub const EXCEPT_ARM_DATA_ABORT : ExceptionType = ExceptionType ( 4 ) ;
118
+ pub const EXCEPT_ARM_DATA_ABORT : Self = Self ( 4 ) ;
119
119
/// Reserved
120
- pub const EXCEPT_ARM_RESERVED : ExceptionType = ExceptionType ( 5 ) ;
120
+ pub const EXCEPT_ARM_RESERVED : Self = Self ( 5 ) ;
121
121
/// Normal interrupt
122
- pub const EXCEPT_ARM_IRQ : ExceptionType = ExceptionType ( 6 ) ;
122
+ pub const EXCEPT_ARM_IRQ : Self = Self ( 6 ) ;
123
123
/// Fast interrupt
124
- pub const EXCEPT_ARM_FIQ : ExceptionType = ExceptionType ( 7 ) ;
124
+ pub const EXCEPT_ARM_FIQ : Self = Self ( 7 ) ;
125
125
/// In the UEFI spec for "convenience", unsure if we'll need it. Set to `EXCEPT_ARM_FIQ`
126
- pub const MAX_ARM_EXCEPTION : ExceptionType = ExceptionType :: EXCEPT_ARM_FIQ ;
126
+ pub const MAX_ARM_EXCEPTION : Self = Self :: EXCEPT_ARM_FIQ ;
127
127
}
128
128
129
129
#[ cfg( target_arch = "aarch64" ) ]
130
130
impl ExceptionType {
131
131
/// Synchronous exception, such as attempting to execute an invalid instruction
132
- pub const EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS : ExceptionType = ExceptionType ( 0 ) ;
132
+ pub const EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS : Self = Self ( 0 ) ;
133
133
/// Normal interrupt
134
- pub const EXCEPT_AARCH64_IRQ : ExceptionType = ExceptionType ( 1 ) ;
134
+ pub const EXCEPT_AARCH64_IRQ : Self = Self ( 1 ) ;
135
135
/// Fast interrupt
136
- pub const EXCEPT_AARCH64_FIQ : ExceptionType = ExceptionType ( 2 ) ;
136
+ pub const EXCEPT_AARCH64_FIQ : Self = Self ( 2 ) ;
137
137
/// System Error
138
- pub const EXCEPT_AARCH64_SERROR : ExceptionType = ExceptionType ( 3 ) ;
138
+ pub const EXCEPT_AARCH64_SERROR : Self = Self ( 3 ) ;
139
139
/// In the UEFI spec for "convenience", unsure if we'll need it. Set to `EXCEPT_AARCH64_SERROR`
140
- pub const MAX_AARCH64_EXCEPTION : ExceptionType = ExceptionType :: EXCEPT_AARCH64_SERROR ;
140
+ pub const MAX_AARCH64_EXCEPTION : Self = Self :: EXCEPT_AARCH64_SERROR ;
141
141
}
142
142
143
143
#[ cfg( any( target_arch = "riscv32" , target_arch = "riscv64" ) ) ]
144
144
impl ExceptionType {
145
145
/// Instruction misaligned
146
- pub const EXCEPT_RISCV_INST_MISALIGNED : ExceptionType = ExceptionType ( 0 ) ;
146
+ pub const EXCEPT_RISCV_INST_MISALIGNED : Self = Self ( 0 ) ;
147
147
/// Instruction access fault
148
- pub const EXCEPT_RISCV_INST_ACCESS_FAULT : ExceptionType = ExceptionType ( 1 ) ;
148
+ pub const EXCEPT_RISCV_INST_ACCESS_FAULT : Self = Self ( 1 ) ;
149
149
/// Illegal instruction
150
- pub const EXCEPT_RISCV_ILLEGAL_INST : ExceptionType = ExceptionType ( 2 ) ;
150
+ pub const EXCEPT_RISCV_ILLEGAL_INST : Self = Self ( 2 ) ;
151
151
/// Breakpoint
152
- pub const EXCEPT_RISCV_BREAKPOINT : ExceptionType = ExceptionType ( 3 ) ;
152
+ pub const EXCEPT_RISCV_BREAKPOINT : Self = Self ( 3 ) ;
153
153
/// Load address misaligned
154
- pub const EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED : ExceptionType = ExceptionType ( 4 ) ;
154
+ pub const EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED : Self = Self ( 4 ) ;
155
155
/// Load accept fault
156
- pub const EXCEPT_RISCV_LOAD_ACCESS_FAULT : ExceptionType = ExceptionType ( 5 ) ;
156
+ pub const EXCEPT_RISCV_LOAD_ACCESS_FAULT : Self = Self ( 5 ) ;
157
157
/// Store AMO address misaligned
158
- pub const EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED : ExceptionType = ExceptionType ( 6 ) ;
158
+ pub const EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED : Self = Self ( 6 ) ;
159
159
/// Store AMO access fault
160
- pub const EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT : ExceptionType = ExceptionType ( 7 ) ;
160
+ pub const EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT : Self = Self ( 7 ) ;
161
161
/// ECALL from User mode
162
- pub const EXCEPT_RISCV_ENV_CALL_FROM_UMODE : ExceptionType = ExceptionType ( 8 ) ;
162
+ pub const EXCEPT_RISCV_ENV_CALL_FROM_UMODE : Self = Self ( 8 ) ;
163
163
/// ECALL from Supervisor mode
164
- pub const EXCEPT_RISCV_ENV_CALL_FROM_SMODE : ExceptionType = ExceptionType ( 9 ) ;
164
+ pub const EXCEPT_RISCV_ENV_CALL_FROM_SMODE : Self = Self ( 9 ) ;
165
165
/// ECALL from Machine mode
166
- pub const EXCEPT_RISCV_ENV_CALL_FROM_MMODE : ExceptionType = ExceptionType ( 11 ) ;
166
+ pub const EXCEPT_RISCV_ENV_CALL_FROM_MMODE : Self = Self ( 11 ) ;
167
167
/// Instruction page fault
168
- pub const EXCEPT_RISCV_INST_PAGE_FAULT : ExceptionType = ExceptionType ( 12 ) ;
168
+ pub const EXCEPT_RISCV_INST_PAGE_FAULT : Self = Self ( 12 ) ;
169
169
/// Load page fault
170
- pub const EXCEPT_RISCV_LOAD_PAGE_FAULT : ExceptionType = ExceptionType ( 13 ) ;
170
+ pub const EXCEPT_RISCV_LOAD_PAGE_FAULT : Self = Self ( 13 ) ;
171
171
/// Store AMO page fault
172
- pub const EXCEPT_RISCV_STORE_AMO_PAGE_FAULT : ExceptionType = ExceptionType ( 15 ) ;
172
+ pub const EXCEPT_RISCV_STORE_AMO_PAGE_FAULT : Self = Self ( 15 ) ;
173
173
// RISC-V interrupt types
174
174
/// Supervisor software interrupt
175
- pub const EXCEPT_RISCV_SUPERVISOR_SOFTWARE_INT : ExceptionType = ExceptionType ( 1 ) ;
175
+ pub const EXCEPT_RISCV_SUPERVISOR_SOFTWARE_INT : Self = Self ( 1 ) ;
176
176
/// Machine software interrupt
177
- pub const EXCEPT_RISCV_MACHINE_SOFTWARE_INT : ExceptionType = ExceptionType ( 3 ) ;
177
+ pub const EXCEPT_RISCV_MACHINE_SOFTWARE_INT : Self = Self ( 3 ) ;
178
178
/// Supervisor timer interrupt
179
- pub const EXCEPT_RISCV_SUPERVISOR_TIMER_INT : ExceptionType = ExceptionType ( 5 ) ;
179
+ pub const EXCEPT_RISCV_SUPERVISOR_TIMER_INT : Self = Self ( 5 ) ;
180
180
/// Machine timer interrupt
181
- pub const EXCEPT_RISCV_MACHINE_TIMER_INT : ExceptionType = ExceptionType ( 7 ) ;
181
+ pub const EXCEPT_RISCV_MACHINE_TIMER_INT : Self = Self ( 7 ) ;
182
182
/// Supervisor external interrupt
183
- pub const EXCEPT_RISCV_SUPERVISOR_EXTERNAL_INT : ExceptionType = ExceptionType ( 9 ) ;
183
+ pub const EXCEPT_RISCV_SUPERVISOR_EXTERNAL_INT : Self = Self ( 9 ) ;
184
184
/// Machine external interrupt
185
- pub const EXCEPT_RISCV_MACHINE_EXTERNAL_INT : ExceptionType = ExceptionType ( 11 ) ;
185
+ pub const EXCEPT_RISCV_MACHINE_EXTERNAL_INT : Self = Self ( 11 ) ;
186
186
}
0 commit comments