From 01ed65f720a32e35d12c7f4d68297e3599157846 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 28 Jul 2023 08:43:09 +0000 Subject: kernel: Cleanup arch abstraction layer git-svn-id: https://svn.vegaa.systems/svn/vega-Vega/trunk@29 a8a8aea2-181d-ee11-89e8-15fd0e089fc4 --- sys/arch/amd64/gdt.c | 6 +++--- sys/arch/amd64/machdep.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'sys/arch/amd64') diff --git a/sys/arch/amd64/gdt.c b/sys/arch/amd64/gdt.c index 446306a..cb32837 100644 --- a/sys/arch/amd64/gdt.c +++ b/sys/arch/amd64/gdt.c @@ -31,7 +31,7 @@ #include -struct gdt_entry g_dmmy_gdt[256] = { +struct gdt_entry g_gdt[256] = { /* Null */ {0}, @@ -76,7 +76,7 @@ struct gdt_entry g_dmmy_gdt[256] = { }, }; -struct gdtr g_early_gdtr = { +struct gdtr g_gdtr = { .limit = sizeof(struct gdt_entry) * 256 - 1, - .offset = (uintptr_t)&g_dmmy_gdt[0] + .offset = (uintptr_t)&g_gdt[0] }; diff --git a/sys/arch/amd64/machdep.c b/sys/arch/amd64/machdep.c index 747d23a..8203a07 100644 --- a/sys/arch/amd64/machdep.c +++ b/sys/arch/amd64/machdep.c @@ -33,13 +33,13 @@ #include #include #include +#include #define ISR(func) ((uintptr_t)func) -__weak void -interrupts_init(struct processor *processor) +static void +interrupts_init(void) { - __USE(processor); idt_set_desc(0x0, IDT_TRAP_GATE_FLAGS, ISR(arith_err), 0); idt_set_desc(0x2, IDT_TRAP_GATE_FLAGS, ISR(nmi), 0); idt_set_desc(0x3, IDT_TRAP_GATE_FLAGS, ISR(breakpoint_handler), 0); @@ -61,8 +61,8 @@ processor_halt(void) } __weak void -processor_init(struct processor *processor) +processor_init(void) { - gdt_load(processor->machdep.gdtr); - interrupts_init(processor); + gdt_load(&g_gdtr); + interrupts_init(); } -- cgit v1.2.3