diff options
author | AlmuHS <almuhs@github.com> | 2019-04-15 19:00:56 +0200 |
---|---|---|
committer | AlmuHS <almuhs@github.com> | 2019-04-15 19:00:56 +0200 |
commit | 10f130de3a3f2c690588aabe33bc3950c795673c (patch) | |
tree | cda2bc6fb6e7d979d5afc74e05c0978c4bf1b615 /kern | |
parent | 33d467f580d7b43803198ff2630df1cd5a6252e8 (diff) |
returned to old implementation
Diffstat (limited to 'kern')
-rw-r--r-- | kern/cpu_number.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kern/cpu_number.c b/kern/cpu_number.c index 60cf9b70..cddbfd18 100644 --- a/kern/cpu_number.c +++ b/kern/cpu_number.c @@ -10,7 +10,13 @@ cpu_number() { if(ncpu == 1 | lapic == 0) return 0; else{ - int apic_id = lapic->apic_id.r >>24; - return apic2kernel[apic_id]; + unsigned apic_id = lapic->apic_id.r >>24; + int i = 0; + + while(i< ncpu && machine_slot[i].apic_id != apic_id) i++; + + if(i == ncpu) return -1; + else return i; + } } |