summaryrefslogtreecommitdiff
path: root/kernel/cpu/pic.h
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-03 21:32:00 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-03 21:32:00 -0400
commit16b7b4c2c008c976ee5948c97a8337d6224c3be9 (patch)
tree70f8402c3a2650d72fb174a43f8893a6f415546b /kernel/cpu/pic.h
parentfix printf (diff)
downloadcomus-16b7b4c2c008c976ee5948c97a8337d6224c3be9.tar.gz
comus-16b7b4c2c008c976ee5948c97a8337d6224c3be9.tar.bz2
comus-16b7b4c2c008c976ee5948c97a8337d6224c3be9.zip
add 64-bit idt/pic and fix paging
Diffstat (limited to 'kernel/cpu/pic.h')
-rw-r--r--kernel/cpu/pic.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/kernel/cpu/pic.h b/kernel/cpu/pic.h
new file mode 100644
index 0000000..0d1aa3a
--- /dev/null
+++ b/kernel/cpu/pic.h
@@ -0,0 +1,42 @@
+/**
+ * @file pic.h
+ *
+ * @author Freya Murphy <freya@freyacat.org>
+ *
+ * PIC functions
+ */
+
+#ifndef PIC_H_
+#define PIC_H_
+
+#define PIC_REMAP_OFFSET 0x20
+
+/**
+ * Remaps the pie, i.e. initializes it
+ */
+void pic_remap(void);
+
+/**
+ * Masks an external irq to stop firing until un masked
+ * @param irq - the irq to mask
+ */
+void pic_mask(int irq);
+
+/**
+ * Unmasks an external irq to allow interrupts to continue for that irq
+ * @param irq - the irq to unmask
+ */
+void pic_unmask(int irq);
+
+/**
+ * Disabled the pick
+ */
+void pic_disable(void);
+
+/**
+ * Tells the pick that the interrupt has ended
+ * @param irq - the irq that has ended
+ */
+void pic_eoi(int irq);
+
+#endif /* pic.h */