From 861073d07b0fd70c5017fa96aa67dd7df4de9443 Mon Sep 17 00:00:00 2001 From: NatrixAeria Date: Mon, 22 Mar 2021 20:36:15 +0100 Subject: Refresh rust version --- kernel/src/interrupts/apic.rs | 8 ++------ kernel/src/interrupts/exception_handlers.rs | 2 +- kernel/src/interrupts/idt.rs | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'kernel/src/interrupts') diff --git a/kernel/src/interrupts/apic.rs b/kernel/src/interrupts/apic.rs index 93fba8b..2761fb9 100644 --- a/kernel/src/interrupts/apic.rs +++ b/kernel/src/interrupts/apic.rs @@ -11,17 +11,13 @@ const APIC_SW_ENABLE: u32 = 0x0000_0100; pub fn is_x2apic() -> bool { let info: u32; - unsafe { - asm!("cpuid" : "={ecx}" (info) : "{eax}" (1) : "memory"); - } + unsafe { asm!("cpuid", inout("eax") 1 => _, out("ecx") info) } info & (1 << 21) != 0 } pub fn is_apic() -> bool { let info: u32; - unsafe { - asm!("cpuid" : "={edx}" (info) : "{eax}" (1) : "memory"); - } + unsafe { asm!("cpuid", inout("eax") 1 => _, out("edx") info) } info & (1 << 9) != 0 } diff --git a/kernel/src/interrupts/exception_handlers.rs b/kernel/src/interrupts/exception_handlers.rs index ef67eff..c689501 100644 --- a/kernel/src/interrupts/exception_handlers.rs +++ b/kernel/src/interrupts/exception_handlers.rs @@ -94,7 +94,7 @@ pub extern "x86-interrupt" fn segment_not_present_handler( pub extern "x86-interrupt" fn double_fault_handler( stack_frame: &mut InterruptStackFrame, _error_code: u64, // code is always zero -) { +) -> ! { match get_expected_fault() { InterruptType::DoubleFault => qemu::exit_qemu(qemu::QemuExitCode::Success), _ => panic!( diff --git a/kernel/src/interrupts/idt.rs b/kernel/src/interrupts/idt.rs index c901916..641e44e 100644 --- a/kernel/src/interrupts/idt.rs +++ b/kernel/src/interrupts/idt.rs @@ -11,7 +11,7 @@ lazy_static! { idt.breakpoint .set_handler_fn(exception_handlers::breakpoint_handler); - idt.divide_by_zero + idt.divide_error .set_handler_fn(exception_handlers::div_zero_handler); idt.segment_not_present .set_handler_fn(exception_handlers::segment_not_present_handler); -- cgit v1.2.3-54-g00ecf