summaryrefslogtreecommitdiff
path: root/kernel/src/interrupts
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/interrupts')
-rw-r--r--kernel/src/interrupts/apic.rs8
-rw-r--r--kernel/src/interrupts/exception_handlers.rs2
-rw-r--r--kernel/src/interrupts/idt.rs2
3 files changed, 4 insertions, 8 deletions
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);