summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-04-17 20:56:16 +0200
committerAlmuHS <almuhs@github.com>2019-04-17 20:56:16 +0200
commit6da4afd05869b552f0575fbe880bcefb5a5e93f8 (patch)
treeba42f57ac5fbf37baf2a7804d96d2ffe3a2546a3 /kern
parent3909c401339478411645e25e2e0abb7dc1723cdb (diff)
reimplemented cpu_number without pointers
Diffstat (limited to 'kern')
-rw-r--r--kern/cpu_number.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kern/cpu_number.c b/kern/cpu_number.c
index ee12b132..412fd004 100644
--- a/kern/cpu_number.c
+++ b/kern/cpu_number.c
@@ -8,9 +8,10 @@ unsigned int master_cpu = 0; /* 'master' processor - keeps time */
int
cpu_number()
{
- if(ncpu == 1 | lapic == 0) return 0;
+ if(ncpu == 1) return 0;
else{
- unsigned apic_id = lapic->apic_id.r >>24;
+ //unsigned apic_id = lapic->apic_id.r >>24;
+ unsigned apic_id = (((ApicLocalUnit*)phystokv(lapic_addr))->apic_id.r >> 24) & 0xff;
return apic2kernel[apic_id];