diff --git a/kern/include/cpu.h b/kern/include/cpu.h index 994f3c1..787c6cf 100644 --- a/kern/include/cpu.h +++ b/kern/include/cpu.h @@ -35,6 +35,7 @@ #include #include /* for TLBSHOOTDOWN_MAX */ +extern unsigned num_cpus; /* * Per-cpu structure diff --git a/kern/thread/thread.c b/kern/thread/thread.c index ae252e4..7a06d07 100644 --- a/kern/thread/thread.c +++ b/kern/thread/thread.c @@ -65,6 +65,7 @@ struct wchan { DECLARRAY(cpu, static __UNUSED inline); DEFARRAY(cpu, static __UNUSED inline); static struct cpuarray allcpus; +unsigned num_cpus; /* Used to wait for secondary CPUs to come online. */ static struct semaphore *cpu_startup_sem; @@ -426,7 +427,8 @@ thread_start_cpus(void) cpu_startup_sem = sem_create("cpu_hatch", 0); mainbus_start_cpus(); - for (i=0; i