diff options
| author | Tianhao Wang <wth@riseup.net> | 2024-02-01 15:10:11 +0100 |
|---|---|---|
| committer | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:13:37 +0200 |
| commit | c01e440d014253fd4cae9f642c949720a54baf4b (patch) | |
| tree | 68d9fc26ccf2f124702b2c2a000892c344f203fe /src/arch/x86_64/interrupt/mod.rs | |
| parent | 753955dbb4e6c77b9c56c659fe766a867c575023 (diff) | |
basic interrupt/PIC support
Diffstat (limited to 'src/arch/x86_64/interrupt/mod.rs')
| -rw-r--r-- | src/arch/x86_64/interrupt/mod.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/arch/x86_64/interrupt/mod.rs b/src/arch/x86_64/interrupt/mod.rs new file mode 100644 index 0000000..3a617e8 --- /dev/null +++ b/src/arch/x86_64/interrupt/mod.rs @@ -0,0 +1,23 @@ +pub mod pic_8259; +pub mod pit; +use crate::io::*; +use core::arch::asm; + +#[no_mangle] +extern "C" fn guardian(slot: u16) { + println!("interrupt received {:x}", slot); +} + +#[inline(always)] +pub fn interrupt_enable() { + unsafe { + asm!("sti"); + } +} + +#[inline(always)] +pub fn interrupt_disable() { + unsafe { + asm!("cli"); + } +} |
