summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-06-27 19:27:52 +0200
committerAlmuHS <almuhs@github.com>2019-06-27 19:27:52 +0200
commit619c68b1c786c7358efc62c30efb4bc8b67ab703 (patch)
tree5f03ec2ce379f2e8cdb8811efac7cb378b4503c2
parente0603719902c282f98dd60ecffdf1dc9c7b1a738 (diff)
experiment: undone shift in apic_id
-rw-r--r--i386/i386/mp_desc.c6
-rw-r--r--kern/cpu_number.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c
index e55b7500..b823c8fe 100644
--- a/i386/i386/mp_desc.c
+++ b/i386/i386/mp_desc.c
@@ -298,6 +298,7 @@ cpu_setup()
{
int i = 1;
+ int kernel_id = 0;
while(i < ncpu && (machine_slot[i].running == TRUE)) i++;
/* assume Pentium 4, Xeon, or later processors */
@@ -351,7 +352,8 @@ cpu_setup()
//slave_main(i);
- //printf("cpu %d enabled\n", cpu_number());
+ kernel_id = cpu_number();
+ printf("cpu %d enabled\n", kernel_id);
return 0;
}
@@ -403,8 +405,6 @@ kern_return_t intel_startCPU(int slot_num)
*/
/*mp_rendezvous_no_intrs(start_cpu, (void *) &start_info);*/
startup_cpu(lapic_id);
- //cpu_up(slot_num);
-
/*
* Initialize (or re-initialize) the descriptor tables for this cpu.
diff --git a/kern/cpu_number.c b/kern/cpu_number.c
index 4101e73c..d9adc584 100644
--- a/kern/cpu_number.c
+++ b/kern/cpu_number.c
@@ -9,8 +9,8 @@ int
cpu_number()
{
if(lapic == 0 | ncpu == 1) return 0;
- else{
- unsigned apic_id = lapic->apic_id.r >>24;
+ else{
+ unsigned apic_id = lapic->apic_id.r;
return apic2kernel[apic_id];