aboutsummaryrefslogtreecommitdiffstats
path: root/src/idt.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/idt.hpp')
-rw-r--r--src/idt.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/idt.hpp b/src/idt.hpp
new file mode 100644
index 0000000..c5e7e47
--- /dev/null
+++ b/src/idt.hpp
@@ -0,0 +1,22 @@
+#ifndef IDT_HPP
+#define IDT_HPP
+
+#include <cstddef>
+#include <cstdint>
+
+struct Registers
+{
+ std::uint32_t inum;
+ std::uint32_t ds;
+ std::uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
+ std::uint32_t error;
+ std::uint32_t eip, cs, eflags;
+} __attribute__((packed));
+
+using Callback = void (*)(const Registers&);
+
+void idt_initialize();
+void idt_register_callback(std::size_t num, Callback cb);
+
+#endif // IDT_HPP
+