aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/interrupt/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86_64/interrupt/mod.rs')
-rw-r--r--src/arch/x86_64/interrupt/mod.rs23
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");
+ }
+}