From fb562d62f0ba448a3f3c57e31a09570ba4b5891b Mon Sep 17 00:00:00 2001 From: skrll Date: Mon, 31 Jan 2011 14:11:02 +0000 Subject: [PATCH] Rename hppa_ncpus hppa_ncpu. Increment for primary CPU only for now. --- sys/arch/hp700/dev/cpu.c | 11 ++++++++--- sys/arch/hp700/include/cpu.h | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sys/arch/hp700/dev/cpu.c b/sys/arch/hp700/dev/cpu.c index 34cd0f97b6b9..dcba4667dbf3 100644 --- a/sys/arch/hp700/dev/cpu.c +++ b/sys/arch/hp700/dev/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.17 2011/01/23 21:53:39 skrll Exp $ */ +/* $NetBSD: cpu.c,v 1.18 2011/01/31 14:11:02 skrll Exp $ */ /* $OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $ */ @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.17 2011/01/23 21:53:39 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.18 2011/01/31 14:11:02 skrll Exp $"); #include "opt_multiprocessor.h" @@ -56,7 +56,8 @@ struct cpu_softc { }; #ifdef MULTIPROCESSOR -int hppa_ncpus; + +int hppa_ncpu; struct cpu_info *cpu_hatch_info; static volatile int start_secondary_cpu; @@ -192,6 +193,7 @@ cpuattach(device_t parent, device_t self, void *aux) if (ci->ci_hpa == hppa_mcpuhpa) { ci->ci_flags |= CPUF_PRIMARY|CPUF_RUNNING; + hppa_ncpu++; } else { int err; @@ -278,6 +280,9 @@ cpu_hatch(void) struct cpu_info *ci = curcpu(); ci->ci_flags |= CPUF_RUNNING; +#if 0 + hppa_ncpu++; +#endif /* Wait for additional CPUs to spinup. */ while (!start_secondary_cpu) diff --git a/sys/arch/hp700/include/cpu.h b/sys/arch/hp700/include/cpu.h index bca549d7868d..e415bc1a5e9d 100644 --- a/sys/arch/hp700/include/cpu.h +++ b/sys/arch/hp700/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.63 2011/01/25 21:27:48 skrll Exp $ */ +/* $NetBSD: cpu.h,v 1.64 2011/01/31 14:11:02 skrll Exp $ */ /* $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $ */ @@ -298,14 +298,14 @@ struct cpu_info { #ifdef MULTIPROCESSOR /* Number of CPUs in the system */ -extern int hppa_ncpus; +extern int hppa_ncpu; #define HPPA_MAXCPUS 4 #define cpu_number() (curcpu()->ci_cpuid) #define CPU_IS_PRIMARY(ci) ((ci)->ci_cpuid == 0) #define CPU_INFO_ITERATOR int -#define CPU_INFO_FOREACH(cii, ci) cii = 0; ci = &cpus[0], cii < hppa_ncpus; cii++, ci++ +#define CPU_INFO_FOREACH(cii, ci) cii = 0; ci = &cpus[0], cii < hppa_ncpu; cii++, ci++ void cpu_boot_secondary_processors(void);