diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-08-06 05:21:03 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-09-07 21:35:03 -0400 |
commit | 6f52707e6882eb3bc6920c3f59beb05d23d68354 (patch) | |
tree | c64ee09a4d2d6169d28daea1f3737d002ffc1402 /arch | |
parent | c7936b9abcf5e043e73f183a37e81787f6178dd0 (diff) |
sh: smp: Hook up a timer IPI stub.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/include/asm/smp.h | 19 | ||||
-rw-r--r-- | arch/sh/kernel/smp.c | 18 |
2 files changed, 31 insertions, 6 deletions
diff --git a/arch/sh/include/asm/smp.h b/arch/sh/include/asm/smp.h index 5ebe0d09559e..9d22cda67c29 100644 --- a/arch/sh/include/asm/smp.h +++ b/arch/sh/include/asm/smp.h | |||
@@ -21,19 +21,26 @@ extern int __cpu_number_map[NR_CPUS]; | |||
21 | extern int __cpu_logical_map[NR_CPUS]; | 21 | extern int __cpu_logical_map[NR_CPUS]; |
22 | #define cpu_logical_map(cpu) __cpu_logical_map[cpu] | 22 | #define cpu_logical_map(cpu) __cpu_logical_map[cpu] |
23 | 23 | ||
24 | #define SMP_MSG_FUNCTION 0 | 24 | enum { |
25 | #define SMP_MSG_RESCHEDULE 1 | 25 | SMP_MSG_FUNCTION, |
26 | #define SMP_MSG_FUNCTION_SINGLE 2 | 26 | SMP_MSG_RESCHEDULE, |
27 | #define SMP_MSG_NR 3 | 27 | SMP_MSG_FUNCTION_SINGLE, |
28 | SMP_MSG_TIMER, | ||
29 | |||
30 | SMP_MSG_NR, /* must be last */ | ||
31 | }; | ||
28 | 32 | ||
29 | void smp_message_recv(unsigned int msg); | 33 | void smp_message_recv(unsigned int msg); |
34 | void smp_timer_broadcast(cpumask_t mask); | ||
35 | |||
30 | void plat_smp_setup(void); | 36 | void plat_smp_setup(void); |
31 | void plat_prepare_cpus(unsigned int max_cpus); | 37 | void plat_prepare_cpus(unsigned int max_cpus); |
32 | int plat_smp_processor_id(void); | 38 | int plat_smp_processor_id(void); |
33 | void plat_start_cpu(unsigned int cpu, unsigned long entry_point); | 39 | void plat_start_cpu(unsigned int cpu, unsigned long entry_point); |
34 | void plat_send_ipi(unsigned int cpu, unsigned int message); | 40 | void plat_send_ipi(unsigned int cpu, unsigned int message); |
35 | extern void arch_send_call_function_single_ipi(int cpu); | 41 | |
36 | extern void arch_send_call_function_ipi(cpumask_t mask); | 42 | void arch_send_call_function_single_ipi(int cpu); |
43 | void arch_send_call_function_ipi(cpumask_t mask); | ||
37 | 44 | ||
38 | #else | 45 | #else |
39 | 46 | ||
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index ebfdd364544f..9cb3734dbd49 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c | |||
@@ -184,6 +184,21 @@ void arch_send_call_function_single_ipi(int cpu) | |||
184 | plat_send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE); | 184 | plat_send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE); |
185 | } | 185 | } |
186 | 186 | ||
187 | void smp_timer_broadcast(cpumask_t mask) | ||
188 | { | ||
189 | int cpu; | ||
190 | |||
191 | for_each_cpu_mask(cpu, mask) | ||
192 | plat_send_ipi(cpu, SMP_MSG_TIMER); | ||
193 | } | ||
194 | |||
195 | static void ipi_timer(void) | ||
196 | { | ||
197 | irq_enter(); | ||
198 | /* XXX ... */ | ||
199 | irq_exit(); | ||
200 | } | ||
201 | |||
187 | void smp_message_recv(unsigned int msg) | 202 | void smp_message_recv(unsigned int msg) |
188 | { | 203 | { |
189 | switch (msg) { | 204 | switch (msg) { |
@@ -195,6 +210,9 @@ void smp_message_recv(unsigned int msg) | |||
195 | case SMP_MSG_FUNCTION_SINGLE: | 210 | case SMP_MSG_FUNCTION_SINGLE: |
196 | generic_smp_call_function_single_interrupt(); | 211 | generic_smp_call_function_single_interrupt(); |
197 | break; | 212 | break; |
213 | case SMP_MSG_TIMER: | ||
214 | ipi_timer(); | ||
215 | break; | ||
198 | default: | 216 | default: |
199 | printk(KERN_WARNING "SMP %d: %s(): unknown IPI %d\n", | 217 | printk(KERN_WARNING "SMP %d: %s(): unknown IPI %d\n", |
200 | smp_processor_id(), __func__, msg); | 218 | smp_processor_id(), __func__, msg); |