diff options
Diffstat (limited to 'i386')
-rw-r--r-- | i386/i386/cpu_number.c | 5 | ||||
-rw-r--r-- | i386/i386/mp_desc.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/i386/i386/cpu_number.c b/i386/i386/cpu_number.c index 42aa6ea1..1d2fab3a 100644 --- a/i386/i386/cpu_number.c +++ b/i386/i386/cpu_number.c @@ -19,12 +19,17 @@ #include <i386/apic.h> #include <i386/smp.h> #include <i386/cpu.h> +#include <i386/mp_desc.h> #include <kern/printf.h> #if NCPUS > 1 int cpu_number(void) { int kernel_id, apic_id; + + if (bspdone == 0) + return 0; + apic_id = apic_get_current_cpu(); if (apic_id < 0) { printf("apic_get_current_cpu() failed, assuming BSP\n"); diff --git a/i386/i386/mp_desc.h b/i386/i386/mp_desc.h index 59d50e77..fea42cd3 100644 --- a/i386/i386/mp_desc.h +++ b/i386/i386/mp_desc.h @@ -76,6 +76,8 @@ extern struct real_descriptor *mp_gdt[NCPUS]; extern uint8_t solid_intstack[]; +extern int bspdone; + /* * Each CPU calls this routine to set up its descriptor tables. */ |