aboutsummaryrefslogtreecommitdiffstats
path: root/idt.hpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2024-09-27 06:02:49 -0400
committerClyne Sullivan <clyne@bitgloo.com>2024-09-27 06:02:49 -0400
commitd43d7caf15a01dd9c2ef1d9e975df3ef7c4e9204 (patch)
treeaaf1f0f3a18b6f7b3fc25022e06941a9fb4fa612 /idt.hpp
wip: initial commit
Diffstat (limited to 'idt.hpp')
-rw-r--r--idt.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/idt.hpp b/idt.hpp
new file mode 100644
index 0000000..c9092dd
--- /dev/null
+++ b/idt.hpp
@@ -0,0 +1,21 @@
+#ifndef IDT_HPP
+#define IDT_HPP
+
+#include <cstddef>
+#include <cstdint>
+
+struct Registers
+{
+ std::uint32_t inum;
+ 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
+