From 1b67d8eaba4a969217c94344dcb970099ee08821 Mon Sep 17 00:00:00 2001 From: Elfein Landers Date: Sat, 6 Aug 2022 20:56:08 -0700 Subject: [PATCH] documented --- ableos/src/arch/x86_64/interrupts.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ableos/src/arch/x86_64/interrupts.rs b/ableos/src/arch/x86_64/interrupts.rs index 54459cd6..8813509e 100644 --- a/ableos/src/arch/x86_64/interrupts.rs +++ b/ableos/src/arch/x86_64/interrupts.rs @@ -89,6 +89,15 @@ extern "x86-interrupt" fn double_fault_handler( // panic!("EXCEPTION: DOUBLE FAULT\n{:#?}", stack_frame); } +/* SAFETY +* DO NOT TOUCH +* The `#[naked]` macro removes various error/bounds checks that +* the Rust compiler would normally add. +* *Early return* and *enabling interrupts* in this function are +* undefined behavior. +* As long as nothing in this function does something that would +* normally trigger an error, this function is relatively safe. +*/ #[naked] extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) { use super::task_switcher;