aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-09-24 11:34:43 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-09-23 20:04:44 -0400
commitc2a3a4881dc851ec9b5bdc83fdc03afa31d6fbed (patch)
tree9396074904e54ff4aef723ce367b088839df65e7
parent81065e4f2b525410d0c80040140e086abfbf7de2 (diff)
cpumask: arch_send_call_function_ipi_mask: m32r
We're weaning the core code off handing cpumask's around on-stack. This introduces arch_send_call_function_ipi_mask(), and by defining it, the old arch_send_call_function_ipi is defined by the core code. We also take the chance to wean the implementations off the obsolescent for_each_cpu_mask(): making send_ipi_mask take the pointer seemed the most natural way to ensure all implementations used for_each_cpu. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--arch/m32r/include/asm/smp.h3
-rw-r--r--arch/m32r/kernel/smp.c22
2 files changed, 13 insertions, 12 deletions
diff --git a/arch/m32r/include/asm/smp.h b/arch/m32r/include/asm/smp.h
index b96a6d2ffbc3..c2be49d408a3 100644
--- a/arch/m32r/include/asm/smp.h
+++ b/arch/m32r/include/asm/smp.h
@@ -88,7 +88,8 @@ extern void smp_send_timer(void);
88extern unsigned long send_IPI_mask_phys(cpumask_t, int, int); 88extern unsigned long send_IPI_mask_phys(cpumask_t, int, int);
89 89
90extern void arch_send_call_function_single_ipi(int cpu); 90extern void arch_send_call_function_single_ipi(int cpu);
91extern void arch_send_call_function_ipi(cpumask_t mask); 91extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
92#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
92 93
93#endif /* not __ASSEMBLY__ */ 94#endif /* not __ASSEMBLY__ */
94 95
diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c
index 929e5c9d3ad9..45c512bcd4ca 100644
--- a/arch/m32r/kernel/smp.c
+++ b/arch/m32r/kernel/smp.c
@@ -85,7 +85,7 @@ void smp_ipi_timer_interrupt(struct pt_regs *);
85void smp_local_timer_interrupt(void); 85void smp_local_timer_interrupt(void);
86 86
87static void send_IPI_allbutself(int, int); 87static void send_IPI_allbutself(int, int);
88static void send_IPI_mask(cpumask_t, int, int); 88static void send_IPI_mask(const struct cpumask *, int, int);
89unsigned long send_IPI_mask_phys(cpumask_t, int, int); 89unsigned long send_IPI_mask_phys(cpumask_t, int, int);
90 90
91/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/ 91/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
@@ -113,7 +113,7 @@ unsigned long send_IPI_mask_phys(cpumask_t, int, int);
113void smp_send_reschedule(int cpu_id) 113void smp_send_reschedule(int cpu_id)
114{ 114{
115 WARN_ON(cpu_is_offline(cpu_id)); 115 WARN_ON(cpu_is_offline(cpu_id));
116 send_IPI_mask(cpumask_of_cpu(cpu_id), RESCHEDULE_IPI, 1); 116 send_IPI_mask(cpumask_of(cpu_id), RESCHEDULE_IPI, 1);
117} 117}
118 118
119/*==========================================================================* 119/*==========================================================================*
@@ -168,7 +168,7 @@ void smp_flush_cache_all(void)
168 spin_lock(&flushcache_lock); 168 spin_lock(&flushcache_lock);
169 mask=cpus_addr(cpumask); 169 mask=cpus_addr(cpumask);
170 atomic_set_mask(*mask, (atomic_t *)&flushcache_cpumask); 170 atomic_set_mask(*mask, (atomic_t *)&flushcache_cpumask);
171 send_IPI_mask(cpumask, INVALIDATE_CACHE_IPI, 0); 171 send_IPI_mask(&cpumask, INVALIDATE_CACHE_IPI, 0);
172 _flush_cache_copyback_all(); 172 _flush_cache_copyback_all();
173 while (flushcache_cpumask) 173 while (flushcache_cpumask)
174 mb(); 174 mb();
@@ -424,7 +424,7 @@ static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm,
424 * We have to send the IPI only to 424 * We have to send the IPI only to
425 * CPUs affected. 425 * CPUs affected.
426 */ 426 */
427 send_IPI_mask(cpumask, INVALIDATE_TLB_IPI, 0); 427 send_IPI_mask(&cpumask, INVALIDATE_TLB_IPI, 0);
428 428
429 while (!cpus_empty(flush_cpumask)) { 429 while (!cpus_empty(flush_cpumask)) {
430 /* nothing. lockup detection does not belong here */ 430 /* nothing. lockup detection does not belong here */
@@ -546,14 +546,14 @@ static void stop_this_cpu(void *dummy)
546 for ( ; ; ); 546 for ( ; ; );
547} 547}
548 548
549void arch_send_call_function_ipi(cpumask_t mask) 549void arch_send_call_function_ipi_mask(const struct cpumask *mask)
550{ 550{
551 send_IPI_mask(mask, CALL_FUNCTION_IPI, 0); 551 send_IPI_mask(mask, CALL_FUNCTION_IPI, 0);
552} 552}
553 553
554void arch_send_call_function_single_ipi(int cpu) 554void arch_send_call_function_single_ipi(int cpu)
555{ 555{
556 send_IPI_mask(cpumask_of_cpu(cpu), CALL_FUNC_SINGLE_IPI, 0); 556 send_IPI_mask(cpumask_of(cpu), CALL_FUNC_SINGLE_IPI, 0);
557} 557}
558 558
559/*==========================================================================* 559/*==========================================================================*
@@ -729,7 +729,7 @@ static void send_IPI_allbutself(int ipi_num, int try)
729 cpumask = cpu_online_map; 729 cpumask = cpu_online_map;
730 cpu_clear(smp_processor_id(), cpumask); 730 cpu_clear(smp_processor_id(), cpumask);
731 731
732 send_IPI_mask(cpumask, ipi_num, try); 732 send_IPI_mask(&cpumask, ipi_num, try);
733} 733}
734 734
735/*==========================================================================* 735/*==========================================================================*
@@ -752,7 +752,7 @@ static void send_IPI_allbutself(int ipi_num, int try)
752 * ---------- --- -------------------------------------------------------- 752 * ---------- --- --------------------------------------------------------
753 * 753 *
754 *==========================================================================*/ 754 *==========================================================================*/
755static void send_IPI_mask(cpumask_t cpumask, int ipi_num, int try) 755static void send_IPI_mask(const struct cpumask *cpumask, int ipi_num, int try)
756{ 756{
757 cpumask_t physid_mask, tmp; 757 cpumask_t physid_mask, tmp;
758 int cpu_id, phys_id; 758 int cpu_id, phys_id;
@@ -761,11 +761,11 @@ static void send_IPI_mask(cpumask_t cpumask, int ipi_num, int try)
761 if (num_cpus <= 1) /* NO MP */ 761 if (num_cpus <= 1) /* NO MP */
762 return; 762 return;
763 763
764 cpus_and(tmp, cpumask, cpu_online_map); 764 cpumask_and(&tmp, cpumask, cpu_online_mask);
765 BUG_ON(!cpus_equal(cpumask, tmp)); 765 BUG_ON(!cpumask_equal(cpumask, &tmp));
766 766
767 physid_mask = CPU_MASK_NONE; 767 physid_mask = CPU_MASK_NONE;
768 for_each_cpu_mask(cpu_id, cpumask){ 768 for_each_cpu(cpu_id, cpumask) {
769 if ((phys_id = cpu_to_physid(cpu_id)) != -1) 769 if ((phys_id = cpu_to_physid(cpu_id)) != -1)
770 cpu_set(phys_id, physid_mask); 770 cpu_set(phys_id, physid_mask);
771 } 771 }