Skip to content

Commit

Permalink
Take ExceptionStackFrame by value
Browse files Browse the repository at this point in the history
Since LLVM 12 (rust-lang/rust#84230) ExceptionStackFrame has to be taken by value. See rust-lang/rust#40180 (comment).
  • Loading branch information
stlankes committed Dec 8, 2021
1 parent 92b821c commit 2595648
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
44 changes: 22 additions & 22 deletions src/arch/x86_64/kernel/irq.rs
Expand Up @@ -100,7 +100,7 @@ pub fn send_eoi_to_master() {
// 6: Invalid Opcode Exception
// 7: Coprocessor Not Available Exception

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

extern "x86-interrupt" fn debug_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn debug_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a Debug Exception: {:#?}",
get_current_taskid(),
Expand All @@ -120,7 +120,7 @@ extern "x86-interrupt" fn debug_exception(stack_frame: &mut ExceptionStackFrame)
abort();
}

extern "x86-interrupt" fn nmi_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn nmi_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a Non Maskable Interrupt Exception: {:#?}",
get_current_taskid(),
Expand All @@ -130,7 +130,7 @@ extern "x86-interrupt" fn nmi_exception(stack_frame: &mut ExceptionStackFrame) {
abort();
}

extern "x86-interrupt" fn int3_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn int3_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a Int 3 Exception: {:#?}",
get_current_taskid(),
Expand All @@ -140,7 +140,7 @@ extern "x86-interrupt" fn int3_exception(stack_frame: &mut ExceptionStackFrame)
abort();
}

extern "x86-interrupt" fn int0_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn int0_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a INT0 Exception: {:#?}",
get_current_taskid(),
Expand All @@ -150,7 +150,7 @@ extern "x86-interrupt" fn int0_exception(stack_frame: &mut ExceptionStackFrame)
abort();
}

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

extern "x86-interrupt" fn invalid_opcode_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn invalid_opcode_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a Invalid Opcode Exception: {:#?}",
get_current_taskid(),
Expand All @@ -170,7 +170,7 @@ extern "x86-interrupt" fn invalid_opcode_exception(stack_frame: &mut ExceptionSt
abort();
}

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

extern "x86-interrupt" fn double_fault_exception(
stack_frame: &mut ExceptionStackFrame,
stack_frame: ExceptionStackFrame,
error_code: u64,
) {
info!(
Expand All @@ -198,7 +198,7 @@ extern "x86-interrupt" fn double_fault_exception(

// 9: Coprocessor Segment Overrun Exception

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

extern "x86-interrupt" fn bad_tss_exception(
stack_frame: &mut ExceptionStackFrame,
stack_frame: ExceptionStackFrame,
error_code: u64,
) {
info!(
Expand All @@ -229,7 +229,7 @@ extern "x86-interrupt" fn bad_tss_exception(
}

extern "x86-interrupt" fn not_present_exception(
stack_frame: &mut ExceptionStackFrame,
stack_frame: ExceptionStackFrame,
error_code: u64,
) {
info!(
Expand All @@ -243,7 +243,7 @@ extern "x86-interrupt" fn not_present_exception(
}

extern "x86-interrupt" fn stack_fault_exception(
stack_frame: &mut ExceptionStackFrame,
stack_frame: ExceptionStackFrame,
error_code: u64,
) {
info!(
Expand All @@ -257,7 +257,7 @@ extern "x86-interrupt" fn stack_fault_exception(
}

extern "x86-interrupt" fn general_protection_exception(
stack_frame: &mut ExceptionStackFrame,
stack_frame: ExceptionStackFrame,
error_code: u64,
) {
info!(
Expand All @@ -276,7 +276,7 @@ extern "x86-interrupt" fn general_protection_exception(
// 18: Machine Check Exception
// 19-31: Reserved

extern "x86-interrupt" fn floating_point_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn floating_point_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a Floating Point Exception: {:#?}",
get_current_taskid(),
Expand All @@ -286,7 +286,7 @@ extern "x86-interrupt" fn floating_point_exception(stack_frame: &mut ExceptionSt
abort();
}

extern "x86-interrupt" fn alignment_check_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn alignment_check_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a Alignment Check Exception: {:#?}",
get_current_taskid(),
Expand All @@ -296,7 +296,7 @@ extern "x86-interrupt" fn alignment_check_exception(stack_frame: &mut ExceptionS
abort();
}

extern "x86-interrupt" fn machine_check_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn machine_check_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a Machine Check Exception: {:#?}",
get_current_taskid(),
Expand All @@ -306,7 +306,7 @@ extern "x86-interrupt" fn machine_check_exception(stack_frame: &mut ExceptionSta
abort();
}

extern "x86-interrupt" fn reserved_exception(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn reserved_exception(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive a reserved exception: {:#?}",
get_current_taskid(),
Expand All @@ -316,7 +316,7 @@ extern "x86-interrupt" fn reserved_exception(stack_frame: &mut ExceptionStackFra
abort();
}

extern "x86-interrupt" fn unhandled_irq1(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn unhandled_irq1(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive unknown interrupt: {:#?}",
get_current_taskid(),
Expand All @@ -326,7 +326,7 @@ extern "x86-interrupt" fn unhandled_irq1(stack_frame: &mut ExceptionStackFrame)
abort();
}

extern "x86-interrupt" fn unhandled_irq2(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn unhandled_irq2(stack_frame: ExceptionStackFrame) {
info!(
"Task {} receive unknown interrupt: {:#?}",
get_current_taskid(),
Expand All @@ -337,7 +337,7 @@ extern "x86-interrupt" fn unhandled_irq2(stack_frame: &mut ExceptionStackFrame)
abort();
}

extern "x86-interrupt" fn timer_handler(stack_frame: &mut ExceptionStackFrame) {
extern "x86-interrupt" fn timer_handler(stack_frame: ExceptionStackFrame) {
debug!(
"Task {} receive timer interrupt!\n{:#?}",
get_current_taskid(),
Expand Down Expand Up @@ -443,7 +443,7 @@ impl InteruptHandler {
pub fn add_handler(
&mut self,
int_no: usize,
func: extern "x86-interrupt" fn(&mut ExceptionStackFrame),
func: extern "x86-interrupt" fn(ExceptionStackFrame),
) {
if int_no < IDT_ENTRIES {
self.idt[int_no] = IdtEntry::new(
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86_64/mm/paging.rs
Expand Up @@ -633,7 +633,7 @@ where
}

pub extern "x86-interrupt" fn page_fault_handler(
stack_frame: &mut irq::ExceptionStackFrame,
stack_frame: irq::ExceptionStackFrame,
error_code: u64,
) {
let mut virtual_address = unsafe { controlregs::cr2() };
Expand Down

0 comments on commit 2595648

Please sign in to comment.