]> git.dujemihanovic.xyz Git - nameless-os.git/blobdiff - include/arch/x86/irq/idt.h
Use interrupt frame and new double fault handler
[nameless-os.git] / include / arch / x86 / irq / idt.h
index 8b2efa1b1aa453beb1583d11cc6d5ef9381eb032..f16cf9672124c3b5a14afd4a97ab07d4aca92194 100644 (file)
@@ -2,12 +2,13 @@
 #define X86_IDT_H
 
 #include <stdint.h>
+#include <irq/interrupt.h>
 
 #define IDT_VECTOR_COUNT 256 /* our IDT will have 256 vectors */
 #define IDT_DESCRIPTOR_SIZE 8 /* each IDT descriptor is 8 bytes long */
 
-#define IDT_TRAP_GATE          0x1F
-#define IDT_INTERRUPT_GATE     0x0E
+#define IDT_TRAP_GATE          0xF
+#define IDT_INTERRUPT_GATE     0xE
 
 struct idt_descriptor {
        uint16_t offset_1; /* bits 0-15 of offset */
@@ -21,7 +22,7 @@ struct idtr {
        uint32_t base; /* starting address of IDT */
 } __attribute__((packed));
 
-extern void idt_set_descriptor(struct idt_descriptor *idt, uint8_t vector, uint16_t segment, uint32_t offset, uint8_t type, uint8_t dpl);
+extern void idt_set_descriptor(struct idt_descriptor *idt, uint8_t vector, uint16_t segment, void (*offset)(void), uint8_t type, uint8_t dpl);
 extern inline void load_idt(struct idtr idtr);
 extern inline void populate_idtr(struct idtr *idtr, struct idt_descriptor *idt);