Skip to content

Commit f5cd3d6

Browse files
committed
Take InterruptStackFrame by value
1 parent 9cda08b commit f5cd3d6

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/structures/idt.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -572,18 +572,17 @@ pub struct Entry<F> {
572572
}
573573

574574
/// A handler function for an interrupt or an exception without error code.
575-
pub type HandlerFunc = extern "x86-interrupt" fn(&mut InterruptStackFrame);
575+
pub type HandlerFunc = extern "x86-interrupt" fn(InterruptStackFrame);
576576
/// A handler function for an exception that pushes an error code.
577-
pub type HandlerFuncWithErrCode =
578-
extern "x86-interrupt" fn(&mut InterruptStackFrame, error_code: u64);
577+
pub type HandlerFuncWithErrCode = extern "x86-interrupt" fn(InterruptStackFrame, error_code: u64);
579578
/// A page fault handler function that pushes a page fault error code.
580579
pub type PageFaultHandlerFunc =
581-
extern "x86-interrupt" fn(&mut InterruptStackFrame, error_code: PageFaultErrorCode);
580+
extern "x86-interrupt" fn(InterruptStackFrame, error_code: PageFaultErrorCode);
582581
/// A handler function that must not return, e.g. for a machine check exception.
583-
pub type DivergingHandlerFunc = extern "x86-interrupt" fn(&mut InterruptStackFrame) -> !;
582+
pub type DivergingHandlerFunc = extern "x86-interrupt" fn(InterruptStackFrame) -> !;
584583
/// A handler function with an error code that must not return, e.g. for a double fault exception.
585584
pub type DivergingHandlerFuncWithErrCode =
586-
extern "x86-interrupt" fn(&mut InterruptStackFrame, error_code: u64) -> !;
585+
extern "x86-interrupt" fn(InterruptStackFrame, error_code: u64) -> !;
587586

588587
impl<F> Entry<F> {
589588
/// Creates a non-present IDT entry (but sets the must-be-one bits).

testing/tests/breakpoint_exception.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ pub fn init_test_idt() {
5757
TEST_IDT.load();
5858
}
5959

60-
extern "x86-interrupt" fn breakpoint_handler(_stack_frame: &mut InterruptStackFrame) {
60+
extern "x86-interrupt" fn breakpoint_handler(_stack_frame: InterruptStackFrame) {
6161
BREAKPOINT_HANDLER_CALLED.fetch_add(1, Ordering::SeqCst);
6262
}

testing/tests/double_fault_stack_overflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn init_test_idt() {
5252
}
5353

5454
extern "x86-interrupt" fn double_fault_handler(
55-
_stack_frame: &mut InterruptStackFrame,
55+
_stack_frame: InterruptStackFrame,
5656
_error_code: u64,
5757
) -> ! {
5858
serial_println!("[ok]");

0 commit comments

Comments
 (0)