summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-01-19 19:54:25 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-01-19 19:54:25 +0000
commitc99bc6a17600dd856af400385089db916f24edd0 (patch)
tree4d83262c71ddf7f6965ff6dff6c7e1d6422628e5 /sys/arch
parent51c784659c6d39636e75fa282bd785f0b411007a (diff)
Compute the right value for hw.ncpusfound sysctl on IP30 regardless of the
value of MAXCPUS.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sgi/sgi/ip30.h4
-rw-r--r--sys/arch/sgi/sgi/ip30_machdep.c14
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/arch/sgi/sgi/ip30.h b/sys/arch/sgi/sgi/ip30.h
index ad52c6e03f9..b9b561ad99b 100644
--- a/sys/arch/sgi/sgi/ip30.h
+++ b/sys/arch/sgi/sgi/ip30.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip30.h,v 1.7 2010/01/13 22:57:30 miod Exp $ */
+/* $OpenBSD: ip30.h,v 1.8 2010/01/19 19:54:24 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -56,6 +56,8 @@
* Multiprocessor configuration area
*/
+#define IP30_MAXCPUS 4
+
#define MPCONF_BASE 0x0000000000000600UL
#define MPCONF_LEN 0x80
diff --git a/sys/arch/sgi/sgi/ip30_machdep.c b/sys/arch/sgi/sgi/ip30_machdep.c
index 94adedde0a8..0ef26740e65 100644
--- a/sys/arch/sgi/sgi/ip30_machdep.c
+++ b/sys/arch/sgi/sgi/ip30_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip30_machdep.c,v 1.34 2010/01/14 07:22:31 miod Exp $ */
+/* $OpenBSD: ip30_machdep.c,v 1.35 2010/01/19 19:54:24 miod Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -232,7 +232,7 @@ ip30_autoconf(struct device *parent)
config_found(parent, &caa, mbprint);
#ifdef MULTIPROCESSOR
- for (cpuid = 1; cpuid < MAXCPUS; cpuid++)
+ for (cpuid = 1; cpuid < IP30_MAXCPUS; cpuid++)
if (ip30_cpu_exists(cpuid)) {
/*
* Attach other processors with the same hardware
@@ -358,11 +358,13 @@ u_long
ip30_get_ncpusfound(void)
{
int i;
- for (i = 1; i < MAXCPUS; i++)
- if (!ip30_cpu_exists(i))
- continue;
+ int ncpus = 0;
+
+ for (i = 0; i < IP30_MAXCPUS; i++)
+ if (ip30_cpu_exists(i))
+ ncpus++;
- return i;
+ return ncpus;
}
#ifdef DDB