summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-11-21 22:23:26 +0000
committerjhb <jhb@FreeBSD.org>2003-11-21 22:23:26 +0000
commitbbe7d290eaefab02b2aae1d8556f86baf226f87c (patch)
tree7f79b01520d78ae23fff9300b063754cafd92b32 /sys/sparc64
parente90ec154d72fc0eab43fed7a064653d3c0666241 (diff)
downloadFreeBSD-src-bbe7d290eaefab02b2aae1d8556f86baf226f87c.zip
FreeBSD-src-bbe7d290eaefab02b2aae1d8556f86baf226f87c.tar.gz
- Split cpu_mp_probe() into two parts. cpu_mp_setmaxid() is still called
very early (SI_SUB_TUNABLES - 1) and is responsible for setting mp_maxid. cpu_mp_probe() is now called at SI_SUB_CPU and determines if SMP is actually present and sets mp_ncpus and all_cpus. Splitting these up allows an architecture to probe CPUs later than SI_SUB_TUNABLES by just setting mp_maxid to MAXCPU in cpu_mp_setmaxid(). This could allow the CPU probing code to live in a module, for example, since modules sysinit's in modules cannot be invoked prior to SI_SUB_KLD. This is needed to re-enable the ACPI module on i386. - For the alpha SMP probing code, use LOCATE_PCS() instead of duplicating its contents in a few places. Also, add a smp_cpu_enabled() function to avoid duplicating some code. There is room for further code reduction later since much of this code is also present in cpu_mp_start(). - All archs besides i386 still set mp_maxid to the same values they set it to before this change. i386 now sets mp_maxid to MAXCPU. Tested on: alpha, amd64, i386, ia64, sparc64 Approved by: re (scottl)
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/mp_machdep.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/sparc64/sparc64/mp_machdep.c b/sys/sparc64/sparc64/mp_machdep.c
index 967ac5a..c26f6f7 100644
--- a/sys/sparc64/sparc64/mp_machdep.c
+++ b/sys/sparc64/sparc64/mp_machdep.c
@@ -140,8 +140,8 @@ mp_tramp_alloc(void)
/*
* Probe for other cpus.
*/
-int
-cpu_mp_probe(void)
+void
+cpu_mp_setmaxid(void)
{
phandle_t child;
phandle_t root;
@@ -160,7 +160,13 @@ cpu_mp_probe(void)
cpus++;
}
mp_maxid = cpus;
- return (cpus > 1);
+}
+
+int
+cpu_mp_probe(void)
+{
+
+ return (mp_maxid > 1);
}
static void
OpenPOWER on IntegriCloud