diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-09-10 19:18:50 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-09-10 19:18:50 +0800 |
| commit | 047a997e3d6e06f6d0a95c473c6f497a88af6b89 (patch) | |
| tree | 3cefae7312cf46930cbe8b75b5fc74cb64df731e /kernel/src/init/int | |
| parent | f0681d59e7c9ea6f2bdfd2be4ebee802d939a5ae (diff) | |
refactor(macros): use macro 2.0
Diffstat (limited to 'kernel/src/init/int')
| -rw-r--r-- | kernel/src/init/int/idt.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/kernel/src/init/int/idt.rs b/kernel/src/init/int/idt.rs index 89228cf..80d42f8 100644 --- a/kernel/src/init/int/idt.rs +++ b/kernel/src/init/int/idt.rs @@ -1,3 +1,8 @@ +use spin::LazyLock; +use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame}; + +use crate::init::earlyprintk::printlnk; + pub static IDT: LazyLock<InterruptDescriptorTable> = LazyLock::new( || { let mut idt = InterruptDescriptorTable::new(); @@ -7,14 +12,13 @@ pub static IDT: LazyLock<InterruptDescriptorTable> = LazyLock::new( }, ); -extern "x86-interrupt" fn double_fault_handler(stack_frame: InterruptStackFrame, error_code: u64) -> ! { +extern "x86-interrupt" fn double_fault_handler( + stack_frame: InterruptStackFrame, + error_code: u64, +) -> ! { panic!("EXCEPTION: DOUBLE FAULT\n{stack_frame:#?}\nERROR CODE:{error_code}"); } extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) { _ = printlnk!("EXCEPTION: BREAKPOINT\n{stack_frame:#?}"); } - -pub fn init() { - IDT.load(); -} |
