diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2009-06-23 05:00:31 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-06-24 13:34:40 -0400 |
commit | 1b2bc75c1bde6581d2694cb3ed7fb06b69685008 (patch) | |
tree | 800fc23052bccb1fbf8acfbaabbf5648c69daa9e /arch/mips/include | |
parent | 4ac4aa5cc3b00cc558575065ae71043e92d1a69a (diff) |
MIPS: Add arch generic CPU hotplug
Each platform has to add support for CPU hotplugging itself by providing
suitable definitions for the cpu_disable and cpu_die of the smp_ops
methods and setting SYS_SUPPORTS_HOTPLUG_CPU. A platform should only set
SYS_SUPPORTS_HOTPLUG_CPU once all it's smp_ops definitions have the
necessary changes. This patch contains the changes to the dummy smp_ops
definition for uni-processor systems.
Parts of the code contributed by Cavium Inc.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/smp-ops.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/smp.h | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/arch/mips/include/asm/smp-ops.h b/arch/mips/include/asm/smp-ops.h index 64ffc0290b84..fd545547b8aa 100644 --- a/arch/mips/include/asm/smp-ops.h +++ b/arch/mips/include/asm/smp-ops.h | |||
@@ -26,6 +26,10 @@ struct plat_smp_ops { | |||
26 | void (*boot_secondary)(int cpu, struct task_struct *idle); | 26 | void (*boot_secondary)(int cpu, struct task_struct *idle); |
27 | void (*smp_setup)(void); | 27 | void (*smp_setup)(void); |
28 | void (*prepare_cpus)(unsigned int max_cpus); | 28 | void (*prepare_cpus)(unsigned int max_cpus); |
29 | #ifdef CONFIG_HOTPLUG_CPU | ||
30 | int (*cpu_disable)(void); | ||
31 | void (*cpu_die)(unsigned int cpu); | ||
32 | #endif | ||
29 | }; | 33 | }; |
30 | 34 | ||
31 | extern void register_smp_ops(struct plat_smp_ops *ops); | 35 | extern void register_smp_ops(struct plat_smp_ops *ops); |
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h index 2f83fa8631db..01f813dc3888 100644 --- a/arch/mips/include/asm/smp.h +++ b/arch/mips/include/asm/smp.h | |||
@@ -41,6 +41,7 @@ extern int __cpu_logical_map[NR_CPUS]; | |||
41 | /* Octeon - Tell another core to flush its icache */ | 41 | /* Octeon - Tell another core to flush its icache */ |
42 | #define SMP_ICACHE_FLUSH 0x4 | 42 | #define SMP_ICACHE_FLUSH 0x4 |
43 | 43 | ||
44 | extern cpumask_t cpu_callin_map; | ||
44 | 45 | ||
45 | extern void asmlinkage smp_bootstrap(void); | 46 | extern void asmlinkage smp_bootstrap(void); |
46 | 47 | ||
@@ -56,6 +57,24 @@ static inline void smp_send_reschedule(int cpu) | |||
56 | mp_ops->send_ipi_single(cpu, SMP_RESCHEDULE_YOURSELF); | 57 | mp_ops->send_ipi_single(cpu, SMP_RESCHEDULE_YOURSELF); |
57 | } | 58 | } |
58 | 59 | ||
60 | #ifdef CONFIG_HOTPLUG_CPU | ||
61 | static inline int __cpu_disable(void) | ||
62 | { | ||
63 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
64 | |||
65 | return mp_ops->cpu_disable(); | ||
66 | } | ||
67 | |||
68 | static inline void __cpu_die(unsigned int cpu) | ||
69 | { | ||
70 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
71 | |||
72 | mp_ops->cpu_die(cpu); | ||
73 | } | ||
74 | |||
75 | extern void play_dead(void); | ||
76 | #endif | ||
77 | |||
59 | extern asmlinkage void smp_call_function_interrupt(void); | 78 | extern asmlinkage void smp_call_function_interrupt(void); |
60 | 79 | ||
61 | extern void arch_send_call_function_single_ipi(int cpu); | 80 | extern void arch_send_call_function_single_ipi(int cpu); |