mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
smp: use alloc instead of pmm_hhdmalloc to allocate ap cls
This commit is contained in:
@@ -20,17 +20,14 @@ static size_t cpucount = 0;
|
|||||||
static void apstartup(struct limine_smp_info *info){
|
static void apstartup(struct limine_smp_info *info){
|
||||||
|
|
||||||
arch_setcls(&apcls[info->processor_id]);
|
arch_setcls(&apcls[info->processor_id]);
|
||||||
|
|
||||||
gdt_init();
|
gdt_init();
|
||||||
|
|
||||||
idt_init();
|
idt_init();
|
||||||
|
|
||||||
arch_mmu_apinit();
|
arch_mmu_apinit();
|
||||||
|
|
||||||
apic_lapicinit();
|
apic_lapicinit();
|
||||||
|
|
||||||
timer_init();
|
timer_init();
|
||||||
|
|
||||||
cpu_state_init();
|
cpu_state_init();
|
||||||
|
|
||||||
printf("CPU %lu ready!\n", info->lapic_id);
|
printf("CPU %lu ready!\n", info->lapic_id);
|
||||||
@@ -64,9 +61,7 @@ void smp_init(){
|
|||||||
cpucount = r->cpu_count;
|
cpucount = r->cpu_count;
|
||||||
struct limine_smp_info** cpus = r->cpus;
|
struct limine_smp_info** cpus = r->cpus;
|
||||||
|
|
||||||
apcls = pmm_hhdmalloc(sizeof(cls_t)*cpucount/PAGE_SIZE+1);
|
apcls = alloc(sizeof(cls_t)*cpucount);
|
||||||
|
|
||||||
memset(apcls, 0, sizeof(cls_t)*cpucount/PAGE_SIZE+1);
|
|
||||||
|
|
||||||
printf("System has %lu CPUs\n", cpucount);
|
printf("System has %lu CPUs\n", cpucount);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user