From 01a23bfd8d32510bacb22af9d8c5bef803758779 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Wed, 17 Apr 2024 21:09:09 +0200 Subject: interrupt: rename `guardian` to `interrupt_gate` --- src/arch/x86_64/interrupt/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/arch/x86_64/interrupt/mod.rs') diff --git a/src/arch/x86_64/interrupt/mod.rs b/src/arch/x86_64/interrupt/mod.rs index ef050b0..410996a 100644 --- a/src/arch/x86_64/interrupt/mod.rs +++ b/src/arch/x86_64/interrupt/mod.rs @@ -5,9 +5,14 @@ use core::arch::asm; #[no_mangle] #[cfg(target_arch = "x86_64")] -extern "C" fn guardian(slot: u16) { +extern "C" fn interrupt_gate(slot: u16) { interrupt_disable(); - println!("interrupt received {:x}", slot); + // NOTE: the interrupt handler should NEVER block on a lock; in this case + // the CGA screen is protected by a spinlock. The lock holder will never be + // able to release the lock if the interrupt handler blocks on it. Try + // spamming the keyboard with the following line of code uncommented: it + // will deadlock! + // println!("interrupt received {:x}", slot); interrupt_enable(); } -- cgit v1.2.3-70-g09d2