diff options
-rw-r--r-- | arch/sparc/kernel/sun4d_smp.c | 32 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4m_smp.c | 45 | ||||
-rw-r--r-- | include/asm-sparc/smp.h | 2 |
3 files changed, 0 insertions, 79 deletions
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index 0def48158c7d..dfde77ff0848 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c | |||
@@ -335,37 +335,6 @@ void smp4d_cross_call_irq(void) | |||
335 | ccall_info.processors_out[i] = 1; | 335 | ccall_info.processors_out[i] = 1; |
336 | } | 336 | } |
337 | 337 | ||
338 | static int smp4d_stop_cpu_sender; | ||
339 | |||
340 | static void smp4d_stop_cpu(void) | ||
341 | { | ||
342 | int me = hard_smp4d_processor_id(); | ||
343 | |||
344 | if (me != smp4d_stop_cpu_sender) | ||
345 | while(1) barrier(); | ||
346 | } | ||
347 | |||
348 | /* Cross calls, in order to work efficiently and atomically do all | ||
349 | * the message passing work themselves, only stopcpu and reschedule | ||
350 | * messages come through here. | ||
351 | */ | ||
352 | void smp4d_message_pass(int target, int msg, unsigned long data, int wait) | ||
353 | { | ||
354 | int me = hard_smp4d_processor_id(); | ||
355 | |||
356 | SMP_PRINTK(("smp4d_message_pass %d %d %08lx %d\n", target, msg, data, wait)); | ||
357 | if (msg == MSG_STOP_CPU && target == MSG_ALL_BUT_SELF) { | ||
358 | unsigned long flags; | ||
359 | static DEFINE_SPINLOCK(stop_cpu_lock); | ||
360 | spin_lock_irqsave(&stop_cpu_lock, flags); | ||
361 | smp4d_stop_cpu_sender = me; | ||
362 | smp4d_cross_call((smpfunc_t)smp4d_stop_cpu, 0, 0, 0, 0, 0); | ||
363 | spin_unlock_irqrestore(&stop_cpu_lock, flags); | ||
364 | } | ||
365 | printk("Yeeee, trying to send SMP msg(%d) to %d on cpu %d\n", msg, target, me); | ||
366 | panic("Bogon SMP message pass."); | ||
367 | } | ||
368 | |||
369 | void smp4d_percpu_timer_interrupt(struct pt_regs *regs) | 338 | void smp4d_percpu_timer_interrupt(struct pt_regs *regs) |
370 | { | 339 | { |
371 | struct pt_regs *old_regs; | 340 | struct pt_regs *old_regs; |
@@ -439,7 +408,6 @@ void __init sun4d_init_smp(void) | |||
439 | BTFIXUPSET_BLACKBOX(hard_smp_processor_id, smp4d_blackbox_id); | 408 | BTFIXUPSET_BLACKBOX(hard_smp_processor_id, smp4d_blackbox_id); |
440 | BTFIXUPSET_BLACKBOX(load_current, smp4d_blackbox_current); | 409 | BTFIXUPSET_BLACKBOX(load_current, smp4d_blackbox_current); |
441 | BTFIXUPSET_CALL(smp_cross_call, smp4d_cross_call, BTFIXUPCALL_NORM); | 410 | BTFIXUPSET_CALL(smp_cross_call, smp4d_cross_call, BTFIXUPCALL_NORM); |
442 | BTFIXUPSET_CALL(smp_message_pass, smp4d_message_pass, BTFIXUPCALL_NORM); | ||
443 | BTFIXUPSET_CALL(__hard_smp_processor_id, __smp4d_processor_id, BTFIXUPCALL_NORM); | 411 | BTFIXUPSET_CALL(__hard_smp_processor_id, __smp4d_processor_id, BTFIXUPCALL_NORM); |
444 | 412 | ||
445 | for (i = 0; i < NR_CPUS; i++) { | 413 | for (i = 0; i < NR_CPUS; i++) { |
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 0b9407267162..ffb875aacb7e 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c | |||
@@ -34,8 +34,6 @@ | |||
34 | 34 | ||
35 | #include "irq.h" | 35 | #include "irq.h" |
36 | 36 | ||
37 | #define IRQ_RESCHEDULE 13 | ||
38 | #define IRQ_STOP_CPU 14 | ||
39 | #define IRQ_CROSS_CALL 15 | 37 | #define IRQ_CROSS_CALL 15 |
40 | 38 | ||
41 | extern ctxd_t *srmmu_ctx_table_phys; | 39 | extern ctxd_t *srmmu_ctx_table_phys; |
@@ -232,48 +230,6 @@ void smp4m_irq_rotate(int cpu) | |||
232 | set_irq_udt(next); | 230 | set_irq_udt(next); |
233 | } | 231 | } |
234 | 232 | ||
235 | /* Cross calls, in order to work efficiently and atomically do all | ||
236 | * the message passing work themselves, only stopcpu and reschedule | ||
237 | * messages come through here. | ||
238 | */ | ||
239 | void smp4m_message_pass(int target, int msg, unsigned long data, int wait) | ||
240 | { | ||
241 | static unsigned long smp_cpu_in_msg[NR_CPUS]; | ||
242 | cpumask_t mask; | ||
243 | int me = smp_processor_id(); | ||
244 | int irq, i; | ||
245 | |||
246 | if(msg == MSG_RESCHEDULE) { | ||
247 | irq = IRQ_RESCHEDULE; | ||
248 | |||
249 | if(smp_cpu_in_msg[me]) | ||
250 | return; | ||
251 | } else if(msg == MSG_STOP_CPU) { | ||
252 | irq = IRQ_STOP_CPU; | ||
253 | } else { | ||
254 | goto barf; | ||
255 | } | ||
256 | |||
257 | smp_cpu_in_msg[me]++; | ||
258 | if(target == MSG_ALL_BUT_SELF || target == MSG_ALL) { | ||
259 | mask = cpu_online_map; | ||
260 | if(target == MSG_ALL_BUT_SELF) | ||
261 | cpu_clear(me, mask); | ||
262 | for(i = 0; i < 4; i++) { | ||
263 | if (cpu_isset(i, mask)) | ||
264 | set_cpu_int(i, irq); | ||
265 | } | ||
266 | } else { | ||
267 | set_cpu_int(target, irq); | ||
268 | } | ||
269 | smp_cpu_in_msg[me]--; | ||
270 | |||
271 | return; | ||
272 | barf: | ||
273 | printk("Yeeee, trying to send SMP msg(%d) on cpu %d\n", msg, me); | ||
274 | panic("Bogon SMP message pass."); | ||
275 | } | ||
276 | |||
277 | static struct smp_funcall { | 233 | static struct smp_funcall { |
278 | smpfunc_t func; | 234 | smpfunc_t func; |
279 | unsigned long arg1; | 235 | unsigned long arg1; |
@@ -413,6 +369,5 @@ void __init sun4m_init_smp(void) | |||
413 | BTFIXUPSET_BLACKBOX(hard_smp_processor_id, smp4m_blackbox_id); | 369 | BTFIXUPSET_BLACKBOX(hard_smp_processor_id, smp4m_blackbox_id); |
414 | BTFIXUPSET_BLACKBOX(load_current, smp4m_blackbox_current); | 370 | BTFIXUPSET_BLACKBOX(load_current, smp4m_blackbox_current); |
415 | BTFIXUPSET_CALL(smp_cross_call, smp4m_cross_call, BTFIXUPCALL_NORM); | 371 | BTFIXUPSET_CALL(smp_cross_call, smp4m_cross_call, BTFIXUPCALL_NORM); |
416 | BTFIXUPSET_CALL(smp_message_pass, smp4m_message_pass, BTFIXUPCALL_NORM); | ||
417 | BTFIXUPSET_CALL(__hard_smp_processor_id, __smp4m_processor_id, BTFIXUPCALL_NORM); | 372 | BTFIXUPSET_CALL(__hard_smp_processor_id, __smp4m_processor_id, BTFIXUPCALL_NORM); |
418 | } | 373 | } |
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h index b3f492208fd2..e6d561599726 100644 --- a/include/asm-sparc/smp.h +++ b/include/asm-sparc/smp.h | |||
@@ -51,13 +51,11 @@ void smp_bogo(struct seq_file *); | |||
51 | void smp_info(struct seq_file *); | 51 | void smp_info(struct seq_file *); |
52 | 52 | ||
53 | BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) | 53 | BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) |
54 | BTFIXUPDEF_CALL(void, smp_message_pass, int, int, unsigned long, int) | ||
55 | BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) | 54 | BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) |
56 | BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) | 55 | BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) |
57 | BTFIXUPDEF_BLACKBOX(load_current) | 56 | BTFIXUPDEF_BLACKBOX(load_current) |
58 | 57 | ||
59 | #define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) | 58 | #define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) |
60 | #define smp_message_pass(target,msg,data,wait) BTFIXUP_CALL(smp_message_pass)(target,msg,data,wait) | ||
61 | 59 | ||
62 | static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } | 60 | static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } |
63 | static inline void xc1(smpfunc_t func, unsigned long arg1) | 61 | static inline void xc1(smpfunc_t func, unsigned long arg1) |