summaryrefslogtreecommitdiff
path: root/include/linux/smp.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2002-07-26 01:28:07 -0700
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-07-26 01:28:07 -0700
commitc5e062079a7090891ea5cd1b23a7eab52b156b2a (patch)
treeb3ed0870f22e6375a39dada4d8d37ea2a94fcfa9 /include/linux/smp.h
parente1eec525be1b708894650a4573d6d7f61e96c4fa (diff)
[PATCH] Hot-plug CPU Boot Changes
This patch alters the boot sequence to "plug in" each CPU, one at a time. You need the patch for each architecture, as well. The interface used to be "smp_boot_cpus()", "smp_commence()", and each arch implemented the "maxcpus" boot arg itself. With this patch, it is: smp_prepare_cpus(maxcpus): probe for cpus and set up cpu_possible(cpu). __cpu_up(cpu): called *after* initcalls, for each cpu where cpu_possible(cpu) is true. smp_cpus_done(maxcpus): called after every cpu has been brought up
Diffstat (limited to 'include/linux/smp.h')
-rw-r--r--include/linux/smp.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/include/linux/smp.h b/include/linux/smp.h
index d6857a229d5d..454fdcdf14d2 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -32,19 +32,19 @@ extern void FASTCALL(smp_send_reschedule(int cpu));
/*
- * Boot processor call to load the other CPU's
+ * Prepare machine for booting other CPUs.
*/
-extern void smp_boot_cpus(void);
+extern void smp_prepare_cpus(unsigned int max_cpus);
/*
- * Processor call in. Must hold processors until ..
+ * Bring a CPU up
*/
-extern void smp_callin(void);
+extern int __cpu_up(unsigned int cpunum);
/*
- * Multiprocessors may now schedule
+ * Final polishing of CPUs
*/
-extern void smp_commence(void);
+extern void smp_cpus_done(unsigned int max_cpus);
/*
* Call a function on all other processors
@@ -71,6 +71,13 @@ extern volatile int smp_msg_id;
#define MSG_RESCHEDULE 0x0003 /* Reschedule request from master CPU*/
#define MSG_CALL_FUNCTION 0x0004 /* Call function on all other CPUs */
+struct notifier_block;
+
+/* Need to know about CPUs going up/down? */
+extern int register_cpu_notifier(struct notifier_block *nb);
+extern void unregister_cpu_notifier(struct notifier_block *nb);
+
+int cpu_up(unsigned int cpu);
#else /* !SMP */
/*
@@ -93,6 +100,10 @@ static inline void smp_send_reschedule_all(void) { }
#define per_cpu(var, cpu) var
#define this_cpu(var) var
+/* Need to know about CPUs going up/down? */
+#define register_cpu_notifier(nb) 0
+#define unregister_cpu_notifier(nb) do { } while(0)
+
#endif /* !SMP */
#define get_cpu() ({ preempt_disable(); smp_processor_id(); })