Skip to content

Commit 6fa0be8

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 875d2c4 commit 6fa0be8

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

src/arch/x86_64/kernel/irq.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub fn send_eoi_to_master() {
100100
// 6: Invalid Opcode Exception
101101
// 7: Coprocessor Not Available Exception
102102

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

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

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

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

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

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

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

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

185185
extern "x86-interrupt" fn double_fault_exception(
186-
stack_frame: &mut ExceptionStackFrame,
186+
stack_frame: ExceptionStackFrame,
187187
error_code: u64,
188188
) {
189189
info!(
@@ -198,7 +198,7 @@ extern "x86-interrupt" fn double_fault_exception(
198198

199199
// 9: Coprocessor Segment Overrun Exception
200200

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

217217
extern "x86-interrupt" fn bad_tss_exception(
218-
stack_frame: &mut ExceptionStackFrame,
218+
stack_frame: ExceptionStackFrame,
219219
error_code: u64,
220220
) {
221221
info!(
@@ -229,7 +229,7 @@ extern "x86-interrupt" fn bad_tss_exception(
229229
}
230230

231231
extern "x86-interrupt" fn not_present_exception(
232-
stack_frame: &mut ExceptionStackFrame,
232+
stack_frame: ExceptionStackFrame,
233233
error_code: u64,
234234
) {
235235
info!(
@@ -243,7 +243,7 @@ extern "x86-interrupt" fn not_present_exception(
243243
}
244244

245245
extern "x86-interrupt" fn stack_fault_exception(
246-
stack_frame: &mut ExceptionStackFrame,
246+
stack_frame: ExceptionStackFrame,
247247
error_code: u64,
248248
) {
249249
info!(
@@ -257,7 +257,7 @@ extern "x86-interrupt" fn stack_fault_exception(
257257
}
258258

259259
extern "x86-interrupt" fn general_protection_exception(
260-
stack_frame: &mut ExceptionStackFrame,
260+
stack_frame: ExceptionStackFrame,
261261
error_code: u64,
262262
) {
263263
info!(
@@ -276,7 +276,7 @@ extern "x86-interrupt" fn general_protection_exception(
276276
// 18: Machine Check Exception
277277
// 19-31: Reserved
278278

279-
extern "x86-interrupt" fn floating_point_exception(stack_frame: &mut ExceptionStackFrame) {
279+
extern "x86-interrupt" fn floating_point_exception(stack_frame: ExceptionStackFrame) {
280280
info!(
281281
"Task {} receive a Floating Point Exception: {:#?}",
282282
get_current_taskid(),
@@ -286,7 +286,7 @@ extern "x86-interrupt" fn floating_point_exception(stack_frame: &mut ExceptionSt
286286
abort();
287287
}
288288

289-
extern "x86-interrupt" fn alignment_check_exception(stack_frame: &mut ExceptionStackFrame) {
289+
extern "x86-interrupt" fn alignment_check_exception(stack_frame: ExceptionStackFrame) {
290290
info!(
291291
"Task {} receive a Alignment Check Exception: {:#?}",
292292
get_current_taskid(),
@@ -296,7 +296,7 @@ extern "x86-interrupt" fn alignment_check_exception(stack_frame: &mut ExceptionS
296296
abort();
297297
}
298298

299-
extern "x86-interrupt" fn machine_check_exception(stack_frame: &mut ExceptionStackFrame) {
299+
extern "x86-interrupt" fn machine_check_exception(stack_frame: ExceptionStackFrame) {
300300
info!(
301301
"Task {} receive a Machine Check Exception: {:#?}",
302302
get_current_taskid(),
@@ -306,7 +306,7 @@ extern "x86-interrupt" fn machine_check_exception(stack_frame: &mut ExceptionSta
306306
abort();
307307
}
308308

309-
extern "x86-interrupt" fn reserved_exception(stack_frame: &mut ExceptionStackFrame) {
309+
extern "x86-interrupt" fn reserved_exception(stack_frame: ExceptionStackFrame) {
310310
info!(
311311
"Task {} receive a reserved exception: {:#?}",
312312
get_current_taskid(),
@@ -316,7 +316,7 @@ extern "x86-interrupt" fn reserved_exception(stack_frame: &mut ExceptionStackFra
316316
abort();
317317
}
318318

319-
extern "x86-interrupt" fn unhandled_irq1(stack_frame: &mut ExceptionStackFrame) {
319+
extern "x86-interrupt" fn unhandled_irq1(stack_frame: ExceptionStackFrame) {
320320
info!(
321321
"Task {} receive unknown interrupt: {:#?}",
322322
get_current_taskid(),
@@ -326,7 +326,7 @@ extern "x86-interrupt" fn unhandled_irq1(stack_frame: &mut ExceptionStackFrame)
326326
abort();
327327
}
328328

329-
extern "x86-interrupt" fn unhandled_irq2(stack_frame: &mut ExceptionStackFrame) {
329+
extern "x86-interrupt" fn unhandled_irq2(stack_frame: ExceptionStackFrame) {
330330
info!(
331331
"Task {} receive unknown interrupt: {:#?}",
332332
get_current_taskid(),
@@ -337,7 +337,7 @@ extern "x86-interrupt" fn unhandled_irq2(stack_frame: &mut ExceptionStackFrame)
337337
abort();
338338
}
339339

340-
extern "x86-interrupt" fn timer_handler(stack_frame: &mut ExceptionStackFrame) {
340+
extern "x86-interrupt" fn timer_handler(stack_frame: ExceptionStackFrame) {
341341
debug!(
342342
"Task {} receive timer interrupt!\n{:#?}",
343343
get_current_taskid(),
@@ -443,7 +443,7 @@ impl InteruptHandler {
443443
pub fn add_handler(
444444
&mut self,
445445
int_no: usize,
446-
func: extern "x86-interrupt" fn(&mut ExceptionStackFrame),
446+
func: extern "x86-interrupt" fn(ExceptionStackFrame),
447447
) {
448448
if int_no < IDT_ENTRIES {
449449
self.idt[int_no] = IdtEntry::new(

src/arch/x86_64/mm/paging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ where
633633
}
634634

635635
pub extern "x86-interrupt" fn page_fault_handler(
636-
stack_frame: &mut irq::ExceptionStackFrame,
636+
stack_frame: irq::ExceptionStackFrame,
637637
error_code: u64,
638638
) {
639639
let mut virtual_address = unsafe { controlregs::cr2() };

0 commit comments

Comments
 (0)