aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/smp.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2003-12-03 14:55:31 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2003-12-03 14:55:31 +0000
commit45c1c90f6a9391e82000622d76fa9b6c3dd5b7c0 (patch)
tree43e2b5c4b744220483a5d1abfee49180d1fc4324 /sys/sys/smp.h
parent019446db3ac6843057e0285ea97f7a1c925b3b24 (diff)
downloadsrc-45c1c90f6a9391e82000622d76fa9b6c3dd5b7c0.tar.gz
src-45c1c90f6a9391e82000622d76fa9b6c3dd5b7c0.zip
Export a few SMP related symbols in UP kernels as well. This is needed to
aid other kernel code, especially code which can be in a module such as the acpi_cpu(4) driver, to work properly with both SMP and UP kernels. The exported symbols include mp_ncpus, all_cpus, mp_maxid, smp_started, and the smp_rendezvous() function. This also means that CPU_ABSENT() is now always implemented the same on all kernels. Approved by: re (scottl)
Notes
Notes: svn path=/head/; revision=123125
Diffstat (limited to 'sys/sys/smp.h')
-rw-r--r--sys/sys/smp.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/sys/smp.h b/sys/sys/smp.h
index 24ef3670b3e4..cd96ebe14f16 100644
--- a/sys/sys/smp.h
+++ b/sys/sys/smp.h
@@ -45,14 +45,16 @@ struct cpu_top {
extern struct cpu_top *smp_topology;
extern void (*cpustop_restartfunc)(void);
-extern int mp_ncpus;
extern int smp_active;
-extern volatile int smp_started;
extern int smp_cpus;
-extern u_int all_cpus;
extern volatile u_int started_cpus;
extern volatile u_int stopped_cpus;
+#endif /* SMP */
+
+extern u_int all_cpus;
extern u_int mp_maxid;
+extern int mp_ncpus;
+extern volatile int smp_started;
/*
* Macro allowing us to determine whether a CPU is absent at any given
@@ -61,6 +63,7 @@ extern u_int mp_maxid;
*/
#define CPU_ABSENT(x_cpu) ((all_cpus & (1 << (x_cpu))) == 0)
+#ifdef SMP
/*
* Machine dependent functions used to initialize MP support.
*
@@ -92,13 +95,11 @@ void forward_roundrobin(void);
int restart_cpus(u_int);
int stop_cpus(u_int);
void smp_rendezvous_action(void);
+#endif /* SMP */
void smp_rendezvous(void (*)(void *),
void (*)(void *),
void (*)(void *),
void *arg);
-#else /* SMP */
-#define CPU_ABSENT(x_cpu) (0)
-#endif /* SMP */
#endif /* !LOCORE */
#endif /* _KERNEL */
#endif /* _SYS_SMP_H_ */