diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-04-26 06:11:51 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-04-26 06:11:51 -0400 |
commit | 54b41b97fd07842d8b64963d538003c5f756ca12 (patch) | |
tree | eb70c7c0dee9e237018c3fda0b5566d6d1338a3b /arch/sh/include/asm | |
parent | e60692b9347d17774cdad00ae2b9afd3dc5444af (diff) | |
parent | e7dc951eecb708d4aef18db4dbf489ba282d16ff (diff) |
Merge branch 'sh/smp'
Diffstat (limited to 'arch/sh/include/asm')
-rw-r--r-- | arch/sh/include/asm/irq.h | 3 | ||||
-rw-r--r-- | arch/sh/include/asm/processor.h | 4 | ||||
-rw-r--r-- | arch/sh/include/asm/smp-ops.h | 51 | ||||
-rw-r--r-- | arch/sh/include/asm/smp.h | 40 |
4 files changed, 90 insertions, 8 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 | ||
52 | void init_IRQ(void); | 53 | void init_IRQ(void); |
54 | void migrate_irqs(void); | ||
55 | |||
53 | asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs); | 56 | asmlinkage 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/processor.h b/arch/sh/include/asm/processor.h index 26b3f026eec9..0a58cb25a658 100644 --- a/arch/sh/include/asm/processor.h +++ b/arch/sh/include/asm/processor.h | |||
@@ -85,6 +85,10 @@ struct sh_cpuinfo { | |||
85 | struct tlb_info itlb; | 85 | struct tlb_info itlb; |
86 | struct tlb_info dtlb; | 86 | struct tlb_info dtlb; |
87 | 87 | ||
88 | #ifdef CONFIG_SMP | ||
89 | struct task_struct *idle; | ||
90 | #endif | ||
91 | |||
88 | unsigned long flags; | 92 | unsigned long flags; |
89 | } __attribute__ ((aligned(L1_CACHE_BYTES))); | 93 | } __attribute__ ((aligned(L1_CACHE_BYTES))); |
90 | 94 | ||
diff --git a/arch/sh/include/asm/smp-ops.h b/arch/sh/include/asm/smp-ops.h new file mode 100644 index 000000000000..c590f76856f1 --- /dev/null +++ b/arch/sh/include/asm/smp-ops.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef __ASM_SH_SMP_OPS_H | ||
2 | #define __ASM_SH_SMP_OPS_H | ||
3 | |||
4 | struct plat_smp_ops { | ||
5 | void (*smp_setup)(void); | ||
6 | unsigned int (*smp_processor_id)(void); | ||
7 | void (*prepare_cpus)(unsigned int max_cpus); | ||
8 | void (*start_cpu)(unsigned int cpu, unsigned long entry_point); | ||
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); | ||
13 | }; | ||
14 | |||
15 | extern struct plat_smp_ops *mp_ops; | ||
16 | extern struct plat_smp_ops shx3_smp_ops; | ||
17 | |||
18 | #ifdef CONFIG_SMP | ||
19 | |||
20 | static inline void plat_smp_setup(void) | ||
21 | { | ||
22 | BUG_ON(!mp_ops); | ||
23 | mp_ops->smp_setup(); | ||
24 | } | ||
25 | |||
26 | static inline void play_dead(void) | ||
27 | { | ||
28 | mp_ops->play_dead(); | ||
29 | } | ||
30 | |||
31 | extern void register_smp_ops(struct plat_smp_ops *ops); | ||
32 | |||
33 | #else | ||
34 | |||
35 | static inline void plat_smp_setup(void) | ||
36 | { | ||
37 | /* UP, nothing to do ... */ | ||
38 | } | ||
39 | |||
40 | static inline void register_smp_ops(struct plat_smp_ops *ops) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | static inline void play_dead(void) | ||
45 | { | ||
46 | BUG(); | ||
47 | } | ||
48 | |||
49 | #endif /* CONFIG_SMP */ | ||
50 | |||
51 | #endif /* __ASM_SH_SMP_OPS_H */ | ||
diff --git a/arch/sh/include/asm/smp.h b/arch/sh/include/asm/smp.h index 53ef26ced75f..9070d943ddde 100644 --- a/arch/sh/include/asm/smp.h +++ b/arch/sh/include/asm/smp.h | |||
@@ -3,15 +3,16 @@ | |||
3 | 3 | ||
4 | #include <linux/bitops.h> | 4 | #include <linux/bitops.h> |
5 | #include <linux/cpumask.h> | 5 | #include <linux/cpumask.h> |
6 | #include <asm/smp-ops.h> | ||
6 | 7 | ||
7 | #ifdef CONFIG_SMP | 8 | #ifdef CONFIG_SMP |
8 | 9 | ||
9 | #include <linux/spinlock.h> | 10 | #include <linux/spinlock.h> |
10 | #include <asm/atomic.h> | 11 | #include <asm/atomic.h> |
11 | #include <asm/current.h> | 12 | #include <asm/current.h> |
13 | #include <asm/percpu.h> | ||
12 | 14 | ||
13 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 15 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
14 | #define hard_smp_processor_id() plat_smp_processor_id() | ||
15 | 16 | ||
16 | /* Map from cpu id to sequential logical cpu number. */ | 17 | /* Map from cpu id to sequential logical cpu number. */ |
17 | extern int __cpu_number_map[NR_CPUS]; | 18 | extern int __cpu_number_map[NR_CPUS]; |
@@ -30,20 +31,43 @@ enum { | |||
30 | SMP_MSG_NR, /* must be last */ | 31 | SMP_MSG_NR, /* must be last */ |
31 | }; | 32 | }; |
32 | 33 | ||
34 | DECLARE_PER_CPU(int, cpu_state); | ||
35 | |||
33 | void smp_message_recv(unsigned int msg); | 36 | void smp_message_recv(unsigned int msg); |
34 | void smp_timer_broadcast(const struct cpumask *mask); | 37 | void smp_timer_broadcast(const struct cpumask *mask); |
35 | 38 | ||
36 | void local_timer_interrupt(void); | 39 | void local_timer_interrupt(void); |
37 | void local_timer_setup(unsigned int cpu); | 40 | void local_timer_setup(unsigned int cpu); |
38 | 41 | void local_timer_stop(unsigned int cpu); | |
39 | void plat_smp_setup(void); | ||
40 | void plat_prepare_cpus(unsigned int max_cpus); | ||
41 | int plat_smp_processor_id(void); | ||
42 | void plat_start_cpu(unsigned int cpu, unsigned long entry_point); | ||
43 | void plat_send_ipi(unsigned int cpu, unsigned int message); | ||
44 | 42 | ||
45 | void arch_send_call_function_single_ipi(int cpu); | 43 | void arch_send_call_function_single_ipi(int cpu); |
46 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | 44 | void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
45 | |||
46 | void native_play_dead(void); | ||
47 | void native_cpu_die(unsigned int cpu); | ||
48 | int native_cpu_disable(unsigned int cpu); | ||
49 | |||
50 | #ifdef CONFIG_HOTPLUG_CPU | ||
51 | void play_dead_common(void); | ||
52 | extern int __cpu_disable(void); | ||
53 | |||
54 | static 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 | ||
61 | |||
62 | static inline int hard_smp_processor_id(void) | ||
63 | { | ||
64 | extern struct plat_smp_ops *mp_ops; /* private */ | ||
65 | |||
66 | if (!mp_ops) | ||
67 | return 0; /* boot CPU */ | ||
68 | |||
69 | return mp_ops->smp_processor_id(); | ||
70 | } | ||
47 | 71 | ||
48 | #else | 72 | #else |
49 | 73 | ||