summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/i386/include/kernel/gdt.h2
-rw-r--r--arch/i386/include/kernel/pic.h4
-rw-r--r--arch/i386/kernel/gdt.c4
-rw-r--r--arch/i386/kernel/idt.c24
-rw-r--r--arch/i386/kernel/pic.c10
-rw-r--r--arch/i386/kernel/serial.c2
-rw-r--r--include/kernel/panic.h2
7 files changed, 22 insertions, 26 deletions
diff --git a/arch/i386/include/kernel/gdt.h b/arch/i386/include/kernel/gdt.h
index 532881a..ec02719 100644
--- a/arch/i386/include/kernel/gdt.h
+++ b/arch/i386/include/kernel/gdt.h
@@ -50,6 +50,4 @@ void write_tss(int num, uint32_t ss0, uint32_t esp0);
void set_kernel_esp(uint32_t esp);
void gdt_install(void);
-void flush_gdt(void);
-
#endif
diff --git a/arch/i386/include/kernel/pic.h b/arch/i386/include/kernel/pic.h
index 2b757ee..187d553 100644
--- a/arch/i386/include/kernel/pic.h
+++ b/arch/i386/include/kernel/pic.h
@@ -35,8 +35,8 @@ void pic_remap(void);
uint16_t pic_get_irr(void);
uint16_t pic_get_isr(void);
-void register_irq_handler(uint8_t irq, void (*handler)(struct regs *regs));
-void irq_dispatch(struct regs *regs);
+void register_irq_handler(uint8_t irq, void (*handler)(struct isr_frame *frame));
+void irq_dispatch(struct isr_frame *frame);
void irq_set_mask(uint8_t irq);
void irq_clear_mask(uint8_t irq);
diff --git a/arch/i386/kernel/gdt.c b/arch/i386/kernel/gdt.c
index c0cf127..9e2dd85 100644
--- a/arch/i386/kernel/gdt.c
+++ b/arch/i386/kernel/gdt.c
@@ -1,6 +1,6 @@
#include <kernel/gdt.h>
#include <kernel/asm.h>
-#include <kernel/string.h>
+#include <libk/string.h>
struct gdt_entry desc[6];
struct gdt_ptr gp;
@@ -53,6 +53,6 @@ void gdt_install(void) {
__asm__ volatile("movl %%esp, %0" : "=r"(esp));
write_tss(5, 0x10, esp);
- flush_gdt();
+ flush_gdt(&gp);
flush_tss();
}
diff --git a/arch/i386/kernel/idt.c b/arch/i386/kernel/idt.c
index 5c0766c..1a06631 100644
--- a/arch/i386/kernel/idt.c
+++ b/arch/i386/kernel/idt.c
@@ -3,10 +3,10 @@
#include <kernel/panic.h>
#include <kernel/gdt.h>
#include <kernel/asm.h>
-#include <kernel/io.h>
#include <kernel/pic.h>
-#include <kernel/string.h>
#include <kernel/paging.h>
+#include <libk/io.h>
+#include <libk/string.h>
#include <stdint.h>
__attribute__((aligned(0x10)))
@@ -45,8 +45,8 @@ const char* exceptions[] = {
"RESERVED"
};
-void exception_handler(struct regs *regs) {
- switch (regs->isr_vector) {
+void exception_handler(struct isr_frame *frame) {
+ switch (frame->isr_vector) {
case 0x00:
panic("Division by zero in kernel address space");
break;
@@ -60,22 +60,22 @@ void exception_handler(struct regs *regs) {
panic("Protection fault in kernel address space");
break;
case 0x0E:
- page_fault_handler(regs);
+ page_fault_handler(frame);
break;
default:
panic("Unhandled exception");
}
}
-void interrupt_handler(struct regs regs) {
- if (regs.isr_vector < 32) {
- exception_handler(&regs);
- } else if (regs.isr_vector < 48) {
- irq_dispatch(&regs);
+void interrupt_handler(struct isr_frame frame) {
+ if (frame.isr_vector < 32) {
+ exception_handler(&frame);
+ } else if (frame.isr_vector < 48) {
+ irq_dispatch(&frame);
} else {
- switch (regs.isr_vector) {
+ switch (frame.isr_vector) {
case 0x80:
- handle_syscall(&regs);
+ handle_syscall(&frame);
break;
default:
panic("Unmapped interrupt");
diff --git a/arch/i386/kernel/pic.c b/arch/i386/kernel/pic.c
index 3cf1d94..0d29473 100644
--- a/arch/i386/kernel/pic.c
+++ b/arch/i386/kernel/pic.c
@@ -1,6 +1,6 @@
#include <kernel/pic.h>
-static void (*irq_handlers[16])(struct regs *regs);
+static void (*irq_handlers[16])(struct isr_frame *frame);
void pic_eoi(uint8_t irq) {
if (irq >= 8)
@@ -38,13 +38,13 @@ uint16_t pic_get_isr(void) {
return _pic_get_irq_reg(PIC_READ_ISR);
}
-void register_irq_handler(uint8_t irq, void (*handler)(struct regs *regs)) {
+void register_irq_handler(uint8_t irq, void (*handler)(struct isr_frame *frame)) {
irq_handlers[irq] = handler;
}
-void irq_dispatch(struct regs *regs) {
- (*irq_handlers[regs->isr_vector-32])(regs);
- pic_eoi(regs->isr_vector-32);
+void irq_dispatch(struct isr_frame *frame) {
+ (*irq_handlers[frame->isr_vector-32])(frame);
+ pic_eoi(frame->isr_vector-32);
return;
}
diff --git a/arch/i386/kernel/serial.c b/arch/i386/kernel/serial.c
index 25a01fe..dc2a8bd 100644
--- a/arch/i386/kernel/serial.c
+++ b/arch/i386/kernel/serial.c
@@ -1,6 +1,6 @@
#include <kernel/serial.h>
#include <kernel/pic.h>
-#include <kernel/string.h>
+#include <libk/string.h>
#include <stddef.h>
#define PORT 0x3f8
diff --git a/include/kernel/panic.h b/include/kernel/panic.h
index e15d6ee..adfcd71 100644
--- a/include/kernel/panic.h
+++ b/include/kernel/panic.h
@@ -6,7 +6,5 @@
#include <stddef.h>
void panic(const char *str);
-void dump_reg(struct regs *regs);
-void dump_stack(struct regs *regs, size_t length);
#endif