diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2025-12-06 20:14:28 -0500 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-12-06 20:14:28 -0500 |
| commit | 2cf843ae6de1f35e5a5d3a947d0179337e82752f (patch) | |
| tree | 7e7983be37568fb0f9cbd806de94573a61df83ca /kernel/include/boot/interrupts.h | |
| parent | 096d9ab61281062b6672c6c9f413de97e034d3f7 (diff) | |
I know; it's POINTLESS! However, I do enjoy programming in C more than
C++ so I ended up spending the hour it takes converting this project
from C++ to C.
Diffstat (limited to 'kernel/include/boot/interrupts.h')
| -rw-r--r-- | kernel/include/boot/interrupts.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/kernel/include/boot/interrupts.h b/kernel/include/boot/interrupts.h index 4df66e9..d436d30 100644 --- a/kernel/include/boot/interrupts.h +++ b/kernel/include/boot/interrupts.h @@ -21,6 +21,7 @@ #include <boot/gdt.h> #include <common.h> +#include <stdbool.h> #include <stdint.h> #define IDT_ENTRY(isr, attributes) \ @@ -36,14 +37,11 @@ #define IDT_PRESENT (1 << 7) #define IDT_KERNEL_PRIVILEGE_LEVEL (0) #define IDT_USER_PRIVILEGE_LEVEL (3 << 5) -#define IDT_TASK_GATE (0b0101) -#define IDT_16BIT_INTERRUPT_GATE (0b0110) -#define IDT_16BIT_TRAP_GATE (0b0111) -#define IDT_32BIT_INTERRUPT_GATE (0b1110) -#define IDT_32BIT_TRAP_GATE (0b1111) - -namespace Interrupts -{ +#define IDT_TASK_GATE (0x05) +#define IDT_16BIT_INTERRUPT_GATE (0x06) +#define IDT_16BIT_TRAP_GATE (0x07) +#define IDT_32BIT_INTERRUPT_GATE (0x0e) +#define IDT_32BIT_TRAP_GATE (0x0f) typedef struct { uint16_t isr_low; @@ -59,16 +57,14 @@ typedef struct { } PACKED descriptor_t; /* Simply loads IDT and enables interrupts */ -void initialize(void); -void enable(void); -void disable(void); +void interrupts_initialize(void); +void interrupts_enable(void); +void interrupts_disable(void); /* IDT */ -void load_idt(void); +void idt_load(void); bool idt_loaded(void); -extern "C" NORETURN void exception_handler(int irq_number); - -} +NORETURN void exception_handler(int irq_number); #endif |
