From 3477df7bde64f65d6e8250cb97b188580540d990 Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 1 Nov 2022 12:38:11 +0100 Subject: [PATCH] Restructure IDT locking --- moon/src/arch/x86_64/interrupts.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/moon/src/arch/x86_64/interrupts.rs b/moon/src/arch/x86_64/interrupts.rs index 89628dbb..d7d0c026 100644 --- a/moon/src/arch/x86_64/interrupts.rs +++ b/moon/src/arch/x86_64/interrupts.rs @@ -21,12 +21,13 @@ extern "x86-interrupt" fn double_fault_handler(stack_frame: InterruptStackFrame, pub fn load() { - IDT.lock().breakpoint.set_handler_fn(breakpoint_handler); - IDT.lock().page_fault.set_handler_fn(page_fault_handler); - IDT.lock().double_fault.set_handler_fn(double_fault_handler); + let mut idt = IDT.lock(); + idt.breakpoint.set_handler_fn(breakpoint_handler); + idt.page_fault.set_handler_fn(page_fault_handler); + idt.double_fault.set_handler_fn(double_fault_handler); unsafe { - IDT.lock().load_unsafe(); + idt.load_unsafe(); } }