summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-10-03 19:01:55 +0200
committerAlmuHS <almuhs@github.com>2019-10-03 19:01:55 +0200
commit4dd07e0787270dbcce2aa6171912ea73bfdd2e4f (patch)
tree935be7378f86fa853e69a62f17d960369d5c051d
parentb076434a3c6303d817dc839d2097bc6f308b6dea (diff)
fix: add shift 24 in apic id
-rw-r--r--i386/i386/cpuboot.S4
-rw-r--r--i386/i386/mp_desc.c2
-rw-r--r--i386/i386at/acpi_rsdp.c4
-rw-r--r--i386/i386at/model_dep.c2
4 files changed, 5 insertions, 7 deletions
diff --git a/i386/i386/cpuboot.S b/i386/i386/cpuboot.S
index b0bccbdb..071b62c9 100644
--- a/i386/i386/cpuboot.S
+++ b/i386/i386/cpuboot.S
@@ -129,6 +129,4 @@ gdt_tmp:
_apbootend:
apbootend:
-// .globl dummyf
-//dummyf:
-ret
+
diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index 10caeb19..557b7e18 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -299,7 +299,7 @@ cpu_setup()
/* assume Pentium 4, Xeon, or later processors */
//unsigned apic_id = (((ApicLocalUnit*)phystokv(lapic_addr))->apic_id.r >> 24) & 0xff;
- unsigned apic_id = lapic->apic_id.r;
+ unsigned apic_id = lapic->apic_id.r >>24;
/* panic? */
if(i >= ncpu)
diff --git a/i386/i386at/acpi_rsdp.c b/i386/i386at/acpi_rsdp.c
index 9617a589..3341407b 100644
--- a/i386/i386at/acpi_rsdp.c
+++ b/i386/i386at/acpi_rsdp.c
@@ -263,9 +263,9 @@ acpi_apic_setup(){
if((lapic_entry->flags & 0x1) && ncpu < NCPUS){
//Enumerate CPU and add It to cpu/apic vector
- machine_slot[ncpu].apic_id = lapic_entry->apic_id;
+ machine_slot[ncpu].apic_id = lapic_entry->apic_id >>24;
machine_slot[ncpu].is_cpu = TRUE;
- apic2kernel[lapic_entry->apic_id] = ncpu;
+ apic2kernel[lapic_entry->apic_id >>24] = ncpu;
//Increase number of CPU
ncpu++;
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index e47ef317..e5ad89a8 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -689,7 +689,7 @@ void c_boot_entry(vm_offset_t bi)
}
if(lapic != 0){
- apic_id = lapic->apic_id.r;
+ apic_id = lapic->apic_id.r >>24;
//update BSP machine_slot and apic2kernel
machine_slot[0].apic_id = apic_id;