This depends on serialised AP init patch. Fixes warnings spewing at boot with APIC and SMP --- i386/i386/cpu_number.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/i386/i386/cpu_number.c b/i386/i386/cpu_number.c index ad4c4b01..eca95d7a 100644 --- a/i386/i386/cpu_number.c +++ b/i386/i386/cpu_number.c @@ -21,10 +21,16 @@ #include <i386/cpu.h> #include <kern/printf.h> +extern int bspdone; + #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"); @@ -36,5 +42,7 @@ int cpu_number(void) printf("apic_get_cpu_kernel_id() failed, assuming BSP\n"); kernel_id = 0; } + + return kernel_id; } #endif -- 2.34.1