From 9e1ae1ff3697e58799d122cfe678b057b4cf543d Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 13 Sep 2022 20:31:20 -0300 Subject: [PATCH] smp: use alloc instead of pmm_hhdmalloc to allocate ap cls --- src/arch/x86_64/smp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/arch/x86_64/smp.c b/src/arch/x86_64/smp.c index 142d13e0..15efa0ab 100644 --- a/src/arch/x86_64/smp.c +++ b/src/arch/x86_64/smp.c @@ -20,17 +20,14 @@ static size_t cpucount = 0; static void apstartup(struct limine_smp_info *info){ arch_setcls(&apcls[info->processor_id]); - + gdt_init(); idt_init(); arch_mmu_apinit(); - apic_lapicinit(); - timer_init(); - cpu_state_init(); printf("CPU %lu ready!\n", info->lapic_id); @@ -64,9 +61,7 @@ void smp_init(){ cpucount = r->cpu_count; struct limine_smp_info** cpus = r->cpus; - apcls = pmm_hhdmalloc(sizeof(cls_t)*cpucount/PAGE_SIZE+1); - - memset(apcls, 0, sizeof(cls_t)*cpucount/PAGE_SIZE+1); + apcls = alloc(sizeof(cls_t)*cpucount); printf("System has %lu CPUs\n", cpucount);