summaryrefslogtreecommitdiff
path: root/kernel/cpu
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-04-18 16:59:49 +0200
committerAnton Kling <anton@kling.gg>2024-04-18 16:59:49 +0200
commit8868c3184a0cebefbf5dad66a0526496f4607df8 (patch)
tree01dc107bf714d14e27ca3f17926b320868716c5a /kernel/cpu
parent568a0b7017e8e779731325083015907b006866c3 (diff)
Kernel: Fix compiler warnings
Diffstat (limited to 'kernel/cpu')
-rw-r--r--kernel/cpu/idt.c14
-rw-r--r--kernel/cpu/idt.h5
2 files changed, 12 insertions, 7 deletions
diff --git a/kernel/cpu/idt.c b/kernel/cpu/idt.c
index ce21d08..9508f8c 100644
--- a/kernel/cpu/idt.c
+++ b/kernel/cpu/idt.c
@@ -217,8 +217,6 @@ void *isr_list[] = {
isr252, isr253, isr254, isr255,
};
-typedef int (*interrupt_handler)(reg_t *);
-
interrupt_handler list_of_handlers[256];
void int_handler(reg_t *r) {
@@ -246,7 +244,8 @@ void int_handler(reg_t *r) {
}
}
-void install_handler(void (*handler_function)(), u16 type_attribute, u8 entry) {
+void install_handler(interrupt_handler handler_function, u16 type_attribute,
+ u8 entry) {
format_descriptor((u32)isr_list[entry], KERNEL_CODE_SEGMENT_OFFSET,
type_attribute, &IDT_Entry[entry]);
list_of_handlers[entry] = (interrupt_handler)handler_function;
@@ -255,9 +254,12 @@ void install_handler(void (*handler_function)(), u16 type_attribute, u8 entry) {
void idt_init(void) {
memset(list_of_handlers, 0, sizeof(void *) * 256);
- install_handler(page_fault, INT_32_INTERRUPT_GATE(0x0), 0xE);
- install_handler(double_fault, INT_32_INTERRUPT_GATE(0x0), 0x8);
- install_handler(general_protection_fault, INT_32_INTERRUPT_GATE(0x0), 0xD);
+ install_handler((interrupt_handler)page_fault, INT_32_INTERRUPT_GATE(0x0),
+ 0xE);
+ install_handler((interrupt_handler)double_fault, INT_32_INTERRUPT_GATE(0x0),
+ 0x8);
+ install_handler((interrupt_handler)general_protection_fault,
+ INT_32_INTERRUPT_GATE(0x0), 0xD);
PIC_remap(0x20);
IRQ_clear_mask(0xb);
diff --git a/kernel/cpu/idt.h b/kernel/cpu/idt.h
index 9cb6e4d..d866659 100644
--- a/kernel/cpu/idt.h
+++ b/kernel/cpu/idt.h
@@ -322,5 +322,8 @@ typedef struct reg {
void idt_init(void);
__attribute__((no_caller_saved_registers)) void EOI(unsigned char irq);
-void install_handler(void (*handler_function)(), u16 type_attribute, u8 entry);
+
+typedef void (*interrupt_handler)(reg_t *);
+void install_handler(interrupt_handler handler_function, u16 type_attribute,
+ u8 entry);
#endif