aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-04-26 06:08:55 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-04-26 06:08:55 -0400
commit763142d1efb56effe614d71185781796c4b83c78 (patch)
treef886c239786fd4be028e3a45006c5cc5c1b3a3f2 /arch/sh/include/asm
parent8db2bc4559639680a94d4492ae4b7ce71298a74f (diff)
sh: CPU hotplug support.
This adds preliminary support for CPU hotplug for SH SMP systems. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm')
-rw-r--r--arch/sh/include/asm/irq.h3
-rw-r--r--arch/sh/include/asm/smp-ops.h16
-rw-r--r--arch/sh/include/asm/smp.h19
3 files changed, 35 insertions, 3 deletions
diff --git a/arch/sh/include/asm/irq.h b/arch/sh/include/asm/irq.h
index 99c593b3a827..02c2f0102cfa 100644
--- a/arch/sh/include/asm/irq.h
+++ b/arch/sh/include/asm/irq.h
@@ -1,6 +1,7 @@
1#ifndef __ASM_SH_IRQ_H 1#ifndef __ASM_SH_IRQ_H
2#define __ASM_SH_IRQ_H 2#define __ASM_SH_IRQ_H
3 3
4#include <linux/cpumask.h>
4#include <asm/machvec.h> 5#include <asm/machvec.h>
5 6
6/* 7/*
@@ -50,6 +51,8 @@ static inline int generic_irq_demux(int irq)
50#define irq_demux(irq) sh_mv.mv_irq_demux(irq) 51#define irq_demux(irq) sh_mv.mv_irq_demux(irq)
51 52
52void init_IRQ(void); 53void init_IRQ(void);
54void migrate_irqs(void);
55
53asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs); 56asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs);
54 57
55#ifdef CONFIG_IRQSTACKS 58#ifdef CONFIG_IRQSTACKS
diff --git a/arch/sh/include/asm/smp-ops.h b/arch/sh/include/asm/smp-ops.h
index 0581b2a4c8ce..c590f76856f1 100644
--- a/arch/sh/include/asm/smp-ops.h
+++ b/arch/sh/include/asm/smp-ops.h
@@ -7,20 +7,27 @@ struct plat_smp_ops {
7 void (*prepare_cpus)(unsigned int max_cpus); 7 void (*prepare_cpus)(unsigned int max_cpus);
8 void (*start_cpu)(unsigned int cpu, unsigned long entry_point); 8 void (*start_cpu)(unsigned int cpu, unsigned long entry_point);
9 void (*send_ipi)(unsigned int cpu, unsigned int message); 9 void (*send_ipi)(unsigned int cpu, unsigned int message);
10 int (*cpu_disable)(unsigned int cpu);
11 void (*cpu_die)(unsigned int cpu);
12 void (*play_dead)(void);
10}; 13};
11 14
15extern struct plat_smp_ops *mp_ops;
12extern struct plat_smp_ops shx3_smp_ops; 16extern struct plat_smp_ops shx3_smp_ops;
13 17
14#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
15 19
16static inline void plat_smp_setup(void) 20static inline void plat_smp_setup(void)
17{ 21{
18 extern struct plat_smp_ops *mp_ops; /* private */
19
20 BUG_ON(!mp_ops); 22 BUG_ON(!mp_ops);
21 mp_ops->smp_setup(); 23 mp_ops->smp_setup();
22} 24}
23 25
26static inline void play_dead(void)
27{
28 mp_ops->play_dead();
29}
30
24extern void register_smp_ops(struct plat_smp_ops *ops); 31extern void register_smp_ops(struct plat_smp_ops *ops);
25 32
26#else 33#else
@@ -34,6 +41,11 @@ static inline void register_smp_ops(struct plat_smp_ops *ops)
34{ 41{
35} 42}
36 43
44static inline void play_dead(void)
45{
46 BUG();
47}
48
37#endif /* CONFIG_SMP */ 49#endif /* CONFIG_SMP */
38 50
39#endif /* __ASM_SH_SMP_OPS_H */ 51#endif /* __ASM_SH_SMP_OPS_H */
diff --git a/arch/sh/include/asm/smp.h b/arch/sh/include/asm/smp.h
index da5135b2579e..9070d943ddde 100644
--- a/arch/sh/include/asm/smp.h
+++ b/arch/sh/include/asm/smp.h
@@ -38,9 +38,26 @@ void smp_timer_broadcast(const struct cpumask *mask);
38 38
39void local_timer_interrupt(void); 39void local_timer_interrupt(void);
40void local_timer_setup(unsigned int cpu); 40void local_timer_setup(unsigned int cpu);
41void local_timer_stop(unsigned int cpu);
41 42
42void arch_send_call_function_single_ipi(int cpu); 43void arch_send_call_function_single_ipi(int cpu);
43extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); 44void arch_send_call_function_ipi_mask(const struct cpumask *mask);
45
46void native_play_dead(void);
47void native_cpu_die(unsigned int cpu);
48int native_cpu_disable(unsigned int cpu);
49
50#ifdef CONFIG_HOTPLUG_CPU
51void play_dead_common(void);
52extern int __cpu_disable(void);
53
54static inline void __cpu_die(unsigned int cpu)
55{
56 extern struct plat_smp_ops *mp_ops; /* private */
57
58 mp_ops->cpu_die(cpu);
59}
60#endif
44 61
45static inline int hard_smp_processor_id(void) 62static inline int hard_smp_processor_id(void)
46{ 63{