diff options
author | jhb <jhb@FreeBSD.org> | 2003-11-21 22:23:26 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-11-21 22:23:26 +0000 |
commit | bbe7d290eaefab02b2aae1d8556f86baf226f87c (patch) | |
tree | 7f79b01520d78ae23fff9300b063754cafd92b32 /sys/sys/smp.h | |
parent | e90ec154d72fc0eab43fed7a064653d3c0666241 (diff) | |
download | FreeBSD-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/sys/smp.h')
-rw-r--r-- | sys/sys/smp.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/smp.h b/sys/sys/smp.h index 277e879..24ef367 100644 --- a/sys/sys/smp.h +++ b/sys/sys/smp.h @@ -74,11 +74,17 @@ extern u_int mp_maxid; * executed and a simple message will be output to the console. Finally, * cpu_mp_announce() will be called so that machine dependent messages about * the MP support may be output to the console if desired. + * + * The cpu_setmaxid() function is called very early during the boot process + * so that the MD code may set mp_maxid to provide an upper bound on CPU IDs + * that other subsystems may use. If a platform is not able to determine + * the exact maximum ID that early, then it may set mp_maxid to MAXCPU. */ struct thread; void cpu_mp_announce(void); int cpu_mp_probe(void); +void cpu_mp_setmaxid(void); void cpu_mp_start(void); void forward_signal(struct thread *); |