initialize mp_ncpus in cpu_mp_probe() so that if the probe fails and

cpu_mp_start() is never called, mp_ncpus will have a non-zero value.
This prevents systat from dying with an arithmatic exception caused
by a divide-by-zero error on UP alphas running a GENERIC kernel.
This commit is contained in:
Andrew Gallatin 2001-06-13 20:40:24 +00:00
parent 607dba5ff6
commit a7f595f8a2

View file

@ -301,6 +301,8 @@ cpu_mp_probe(void)
/* XXX: Need to check for valid platforms here. */
mp_ncpus = 1;
/* Make sure we have at least one secondary CPU. */
cpus = 0;
for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) {
@ -328,8 +330,6 @@ cpu_mp_start()
mtx_init(&ap_boot_mtx, "ap boot", MTX_SPIN);
mp_ncpus = 1;
boot_cpu_id = PCPU_GET(cpuid);
KASSERT(boot_cpu_id == hwrpb->rpb_primary_cpu_id,
("mp_start() called on non-primary CPU"));