Skip to content

Commit 39f136b

Browse files
committed
Take ExceptionStackFrame by value
Since LLVM 12 (rust-lang/rust#84230) ExceptionStackFrame has to be taken by value. See rust-lang/rust#40180 (comment).
1 parent a1d8bda commit 39f136b

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/arch/x86_64/irq.rs

+23-23
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn send_eoi_to_master() {
9999
// 6: Invalid Opcode Exception
100100
// 7: Coprocessor Not Available Exception
101101

102-
extern "x86-interrupt" fn divide_by_zero_exception(stack_frame: &mut ExceptionStackFrame) {
102+
extern "x86-interrupt" fn divide_by_zero_exception(stack_frame: ExceptionStackFrame) {
103103
info!(
104104
"Task {} receive a Divide By Zero Exception: {:#?}",
105105
get_current_taskid(),
@@ -109,7 +109,7 @@ extern "x86-interrupt" fn divide_by_zero_exception(stack_frame: &mut ExceptionSt
109109
abort();
110110
}
111111

112-
extern "x86-interrupt" fn debug_exception(stack_frame: &mut ExceptionStackFrame) {
112+
extern "x86-interrupt" fn debug_exception(stack_frame: ExceptionStackFrame) {
113113
info!(
114114
"Task {} receive a Debug Exception: {:#?}",
115115
get_current_taskid(),
@@ -119,7 +119,7 @@ extern "x86-interrupt" fn debug_exception(stack_frame: &mut ExceptionStackFrame)
119119
abort();
120120
}
121121

122-
extern "x86-interrupt" fn nmi_exception(stack_frame: &mut ExceptionStackFrame) {
122+
extern "x86-interrupt" fn nmi_exception(stack_frame: ExceptionStackFrame) {
123123
info!(
124124
"Task {} receive a Non Maskable Interrupt Exception: {:#?}",
125125
get_current_taskid(),
@@ -129,7 +129,7 @@ extern "x86-interrupt" fn nmi_exception(stack_frame: &mut ExceptionStackFrame) {
129129
abort();
130130
}
131131

132-
extern "x86-interrupt" fn int3_exception(stack_frame: &mut ExceptionStackFrame) {
132+
extern "x86-interrupt" fn int3_exception(stack_frame: ExceptionStackFrame) {
133133
info!(
134134
"Task {} receive a Int 3 Exception: {:#?}",
135135
get_current_taskid(),
@@ -139,7 +139,7 @@ extern "x86-interrupt" fn int3_exception(stack_frame: &mut ExceptionStackFrame)
139139
abort();
140140
}
141141

142-
extern "x86-interrupt" fn int0_exception(stack_frame: &mut ExceptionStackFrame) {
142+
extern "x86-interrupt" fn int0_exception(stack_frame: ExceptionStackFrame) {
143143
info!(
144144
"Task {} receive a INT0 Exception: {:#?}",
145145
get_current_taskid(),
@@ -149,7 +149,7 @@ extern "x86-interrupt" fn int0_exception(stack_frame: &mut ExceptionStackFrame)
149149
abort();
150150
}
151151

152-
extern "x86-interrupt" fn out_of_bound_exception(stack_frame: &mut ExceptionStackFrame) {
152+
extern "x86-interrupt" fn out_of_bound_exception(stack_frame: ExceptionStackFrame) {
153153
info!(
154154
"Task {} receive a Out of Bounds Exception: {:#?}",
155155
get_current_taskid(),
@@ -159,7 +159,7 @@ extern "x86-interrupt" fn out_of_bound_exception(stack_frame: &mut ExceptionStac
159159
abort();
160160
}
161161

162-
extern "x86-interrupt" fn invalid_opcode_exception(stack_frame: &mut ExceptionStackFrame) {
162+
extern "x86-interrupt" fn invalid_opcode_exception(stack_frame: ExceptionStackFrame) {
163163
info!(
164164
"Task {} receive a Invalid Opcode Exception: {:#?}",
165165
get_current_taskid(),
@@ -169,7 +169,7 @@ extern "x86-interrupt" fn invalid_opcode_exception(stack_frame: &mut ExceptionSt
169169
abort();
170170
}
171171

172-
extern "x86-interrupt" fn no_coprocessor_exception(stack_frame: &mut ExceptionStackFrame) {
172+
extern "x86-interrupt" fn no_coprocessor_exception(stack_frame: ExceptionStackFrame) {
173173
info!(
174174
"Task {} receive a Coprocessor Not Available Exception: {:#?}",
175175
get_current_taskid(),
@@ -182,7 +182,7 @@ extern "x86-interrupt" fn no_coprocessor_exception(stack_frame: &mut ExceptionSt
182182
// 8: Double Fault Exception (With Error Code!)
183183

184184
extern "x86-interrupt" fn double_fault_exception(
185-
stack_frame: &mut ExceptionStackFrame,
185+
stack_frame: ExceptionStackFrame,
186186
error_code: u64,
187187
) {
188188
info!(
@@ -197,7 +197,7 @@ extern "x86-interrupt" fn double_fault_exception(
197197

198198
// 9: Coprocessor Segment Overrun Exception
199199

200-
extern "x86-interrupt" fn overrun_exception(stack_frame: &mut ExceptionStackFrame) {
200+
extern "x86-interrupt" fn overrun_exception(stack_frame: ExceptionStackFrame) {
201201
info!(
202202
"Task {} receive a Coprocessor Segment Overrun Exception: {:#?}",
203203
get_current_taskid(),
@@ -214,7 +214,7 @@ extern "x86-interrupt" fn overrun_exception(stack_frame: &mut ExceptionStackFram
214214
// 14: Page Fault Exception (With Error Code!)
215215

216216
extern "x86-interrupt" fn bad_tss_exception(
217-
stack_frame: &mut ExceptionStackFrame,
217+
stack_frame: ExceptionStackFrame,
218218
error_code: u64,
219219
) {
220220
info!(
@@ -228,7 +228,7 @@ extern "x86-interrupt" fn bad_tss_exception(
228228
}
229229

230230
extern "x86-interrupt" fn not_present_exception(
231-
stack_frame: &mut ExceptionStackFrame,
231+
stack_frame: ExceptionStackFrame,
232232
error_code: u64,
233233
) {
234234
info!(
@@ -242,7 +242,7 @@ extern "x86-interrupt" fn not_present_exception(
242242
}
243243

244244
extern "x86-interrupt" fn stack_fault_exception(
245-
stack_frame: &mut ExceptionStackFrame,
245+
stack_frame: ExceptionStackFrame,
246246
error_code: u64,
247247
) {
248248
info!(
@@ -256,7 +256,7 @@ extern "x86-interrupt" fn stack_fault_exception(
256256
}
257257

258258
extern "x86-interrupt" fn general_protection_exception(
259-
stack_frame: &mut ExceptionStackFrame,
259+
stack_frame: ExceptionStackFrame,
260260
error_code: u64,
261261
) {
262262
info!(
@@ -270,7 +270,7 @@ extern "x86-interrupt" fn general_protection_exception(
270270
}
271271

272272
extern "x86-interrupt" fn page_fault_exception(
273-
stack_frame: &mut ExceptionStackFrame,
273+
stack_frame: ExceptionStackFrame,
274274
error_code: u64,
275275
) {
276276
info!(
@@ -289,7 +289,7 @@ extern "x86-interrupt" fn page_fault_exception(
289289
// 18: Machine Check Exception
290290
// 19-31: Reserved
291291

292-
extern "x86-interrupt" fn floating_point_exception(stack_frame: &mut ExceptionStackFrame) {
292+
extern "x86-interrupt" fn floating_point_exception(stack_frame: ExceptionStackFrame) {
293293
info!(
294294
"Task {} receive a Floating Point Exception: {:#?}",
295295
get_current_taskid(),
@@ -299,7 +299,7 @@ extern "x86-interrupt" fn floating_point_exception(stack_frame: &mut ExceptionSt
299299
abort();
300300
}
301301

302-
extern "x86-interrupt" fn alignment_check_exception(stack_frame: &mut ExceptionStackFrame) {
302+
extern "x86-interrupt" fn alignment_check_exception(stack_frame: ExceptionStackFrame) {
303303
info!(
304304
"Task {} receive a Alignment Check Exception: {:#?}",
305305
get_current_taskid(),
@@ -309,7 +309,7 @@ extern "x86-interrupt" fn alignment_check_exception(stack_frame: &mut ExceptionS
309309
abort();
310310
}
311311

312-
extern "x86-interrupt" fn machine_check_exception(stack_frame: &mut ExceptionStackFrame) {
312+
extern "x86-interrupt" fn machine_check_exception(stack_frame: ExceptionStackFrame) {
313313
info!(
314314
"Task {} receive a Machine Check Exception: {:#?}",
315315
get_current_taskid(),
@@ -319,7 +319,7 @@ extern "x86-interrupt" fn machine_check_exception(stack_frame: &mut ExceptionSta
319319
abort();
320320
}
321321

322-
extern "x86-interrupt" fn reserved_exception(stack_frame: &mut ExceptionStackFrame) {
322+
extern "x86-interrupt" fn reserved_exception(stack_frame: ExceptionStackFrame) {
323323
info!(
324324
"Task {} receive a reserved exception: {:#?}",
325325
get_current_taskid(),
@@ -329,7 +329,7 @@ extern "x86-interrupt" fn reserved_exception(stack_frame: &mut ExceptionStackFra
329329
abort();
330330
}
331331

332-
extern "x86-interrupt" fn unhandled_irq1(stack_frame: &mut ExceptionStackFrame) {
332+
extern "x86-interrupt" fn unhandled_irq1(stack_frame: ExceptionStackFrame) {
333333
info!(
334334
"Task {} receive unknown interrupt: {:#?}",
335335
get_current_taskid(),
@@ -339,7 +339,7 @@ extern "x86-interrupt" fn unhandled_irq1(stack_frame: &mut ExceptionStackFrame)
339339
abort();
340340
}
341341

342-
extern "x86-interrupt" fn unhandled_irq2(stack_frame: &mut ExceptionStackFrame) {
342+
extern "x86-interrupt" fn unhandled_irq2(stack_frame: ExceptionStackFrame) {
343343
info!(
344344
"Task {} receive unknown interrupt: {:#?}",
345345
get_current_taskid(),
@@ -350,7 +350,7 @@ extern "x86-interrupt" fn unhandled_irq2(stack_frame: &mut ExceptionStackFrame)
350350
abort();
351351
}
352352

353-
extern "x86-interrupt" fn timer_handler(stack_frame: &mut ExceptionStackFrame) {
353+
extern "x86-interrupt" fn timer_handler(stack_frame: ExceptionStackFrame) {
354354
debug!(
355355
"Task {} receive timer interrupt!\n{:#?}",
356356
get_current_taskid(),
@@ -456,7 +456,7 @@ impl InteruptHandler {
456456
pub fn add_handler(
457457
&mut self,
458458
int_no: usize,
459-
func: extern "x86-interrupt" fn(&mut ExceptionStackFrame),
459+
func: extern "x86-interrupt" fn(ExceptionStackFrame),
460460
) {
461461
if int_no < IDT_ENTRIES {
462462
self.idt[int_no] = IdtEntry::new(

0 commit comments

Comments
 (0)