Nucleus
Barry Basic paging bc5e11e (3 years, 3 months ago)
diff --git a/include/nucleus/cpu.h b/include/nucleus/cpu.h
index 69ef379..2a99c33 100644
--- a/include/nucleus/cpu.h
+++ b/include/nucleus/cpu.h
@@ -1,11 +1,16 @@
#ifndef _NUCLEUS_CPU_H
#define _NUCLEUS_CPU_H
+#include <stdint.h>
+
/* Structure for an Interrupt Frame */
struct InterruptFrame {
uint32_t eip, cs, eflags;
};
+typedef void (*exc_handler_t)(struct InterruptFrame *, uint32_t);
+typedef void (*int_handler_t)(struct InterruptFrame *);
+
extern uintptr_t lapicPtr, ioapicPtr;
#define LAPIC(off) (*((uint32_t *) ((uint32_t) lapicPtr + (off))))
#define IOAPIC(off) (*((uint32_t *) ((uint32_t) ioapicPtr + (off))))
@@ -14,4 +19,7 @@ extern uint8_t lapicNums[];
#define CPUID lapicNums[(uint8_t) (LAPIC(0x20) >> 24)]
#define MAX_CPUS 2
+void register_exception(int num, exc_handler_t addr);
+void register_interrupt(int num, int_handler_t addr);
+
#endif