aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/garmos/arch.h15
-rw-r--r--include/garmos/idt.h25
2 files changed, 40 insertions, 0 deletions
diff --git a/include/garmos/arch.h b/include/garmos/arch.h
index 6d0f54d..ff1627e 100644
--- a/include/garmos/arch.h
+++ b/include/garmos/arch.h
@@ -44,4 +44,19 @@ struct gdtp {
} __attribute__((packed));
void gdtset(struct gdtp gdtp);
+/* interrupt description table initialization and activation */
+struct idtp {
+ uint16_t limit;
+ void *pointer;
+} __attribute((packed));
+void idtset(struct idtp idtp);
+void idtact(void);
+
+/* interrupt handler for ignores and a list of handlers to register */
+extern uint8_t irqnos[];
+extern uint32_t irqhdls[];
+void irqign(void);
+void irqhdl0x00(void);
+void irqhdl0x01(void);
+
#endif
diff --git a/include/garmos/idt.h b/include/garmos/idt.h
new file mode 100644
index 0000000..05fb1bd
--- /dev/null
+++ b/include/garmos/idt.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2017 Robin Krahl <robin.krahl@ireas.org>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation, either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ */
+
+#ifndef GARMOS_IDT_H
+#define GARMOS_IDT_H
+
+#include <garmos/types.h>
+
+void idt_init(void);
+void idt_activate(void);
+
+uint32_t idt_handle_interrupt(uint8_t no, uint32_t esp);
+
+#endif