diff options
author | AlmuHS <almuhs@github.com> | 2019-10-03 19:17:52 +0200 |
---|---|---|
committer | AlmuHS <almuhs@github.com> | 2019-10-03 19:17:52 +0200 |
commit | d0b1740a736cb5497e4541a7591ac62e2595e2f3 (patch) | |
tree | 3b7c86c0ddc82ce35a0c36a61c9883df29f3df1c | |
parent | 4dd07e0787270dbcce2aa6171912ea73bfdd2e4f (diff) |
fix: add shift 24 in apic id
-rw-r--r-- | i386/i386at/acpi_rsdp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/i386/i386at/acpi_rsdp.c b/i386/i386at/acpi_rsdp.c index 3341407b..6100c840 100644 --- a/i386/i386at/acpi_rsdp.c +++ b/i386/i386at/acpi_rsdp.c @@ -224,6 +224,8 @@ acpi_get_rsdt(){ static int acpi_apic_setup(){ + unsigned apic_id; + if(apic == 0) return -1; @@ -262,10 +264,12 @@ acpi_apic_setup(){ //If cpu flag is correct, and the maximum number of CPUs is not reached if((lapic_entry->flags & 0x1) && ncpu < NCPUS){ + apic_id = lapic_entry->apic_id >>24; + //Enumerate CPU and add It to cpu/apic vector - machine_slot[ncpu].apic_id = lapic_entry->apic_id >>24; + machine_slot[ncpu].apic_id = apic_id; machine_slot[ncpu].is_cpu = TRUE; - apic2kernel[lapic_entry->apic_id >>24] = ncpu; + apic2kernel[apic_id] = ncpu; //Increase number of CPU ncpu++; |