diff options
author | Danny Holman <dholman@gymli.org> | 2024-05-27 14:24:19 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-05-27 14:24:19 -0500 |
commit | e472fbf564a8dee7ec4cb03b3e77a213a017bc76 (patch) | |
tree | 02cdbf5930774478ec32b64759dca7df4d8ee3cc /arch/i386/kernel | |
parent | d5e63951bdf8c154bafee11c84816539fde77b81 (diff) |
arch: i386: update all files to use the new libk
Update all the files under arch to make use of the new libk
implementation. Most of these changes are simply path changes in include
directives.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/gdt.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/idt.c | 24 | ||||
-rw-r--r-- | arch/i386/kernel/pic.c | 10 | ||||
-rw-r--r-- | arch/i386/kernel/serial.c | 2 |
4 files changed, 20 insertions, 20 deletions
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(®s); - } else if (regs.isr_vector < 48) { - irq_dispatch(®s); +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(®s); + 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 |