diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-04-25 21:57:27 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-05-25 08:24:11 -0400 |
commit | fecedc807116ed820ca6f3138d6d47a3bc6c5a60 (patch) | |
tree | cfeee24f8012b44f5eec50c36a3cd4c3c613bd03 /arch/blackfin/mach-common | |
parent | e887eb61e5a27ba54405f2ca51d8d0d378c4ffe5 (diff) |
Blackfin: convert old cpumask API to new one
old cpu_xxx() APIs is planned to removed later. then, converted.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-common')
-rw-r--r-- | arch/blackfin/mach-common/dpmc.c | 7 | ||||
-rw-r--r-- | arch/blackfin/mach-common/smp.c | 27 |
2 files changed, 18 insertions, 16 deletions
diff --git a/arch/blackfin/mach-common/dpmc.c b/arch/blackfin/mach-common/dpmc.c index 5e4112e518a9..f5685a496c58 100644 --- a/arch/blackfin/mach-common/dpmc.c +++ b/arch/blackfin/mach-common/dpmc.c | |||
@@ -85,10 +85,11 @@ static void bfin_wakeup_cpu(void) | |||
85 | { | 85 | { |
86 | unsigned int cpu; | 86 | unsigned int cpu; |
87 | unsigned int this_cpu = smp_processor_id(); | 87 | unsigned int this_cpu = smp_processor_id(); |
88 | cpumask_t mask = cpu_online_map; | 88 | cpumask_t mask; |
89 | 89 | ||
90 | cpu_clear(this_cpu, mask); | 90 | cpumask_copy(&mask, cpu_online_mask); |
91 | for_each_cpu_mask(cpu, mask) | 91 | cpumask_clear_cpu(this_cpu, &mask); |
92 | for_each_cpu(cpu, &mask) | ||
92 | platform_send_ipi_cpu(cpu, IRQ_SUPPLE_0); | 93 | platform_send_ipi_cpu(cpu, IRQ_SUPPLE_0); |
93 | } | 94 | } |
94 | 95 | ||
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c index c0ac8e643361..35e7e1eb0188 100644 --- a/arch/blackfin/mach-common/smp.c +++ b/arch/blackfin/mach-common/smp.c | |||
@@ -97,7 +97,7 @@ static void ipi_cpu_stop(unsigned int cpu) | |||
97 | dump_stack(); | 97 | dump_stack(); |
98 | spin_unlock(&stop_lock); | 98 | spin_unlock(&stop_lock); |
99 | 99 | ||
100 | cpu_clear(cpu, cpu_online_map); | 100 | set_cpu_online(cpu, false); |
101 | 101 | ||
102 | local_irq_disable(); | 102 | local_irq_disable(); |
103 | 103 | ||
@@ -147,7 +147,7 @@ static void ipi_call_function(unsigned int cpu, struct ipi_message *msg) | |||
147 | */ | 147 | */ |
148 | resync_core_dcache(); | 148 | resync_core_dcache(); |
149 | #endif | 149 | #endif |
150 | cpu_clear(cpu, *msg->call_struct.waitmask); | 150 | cpumask_clear_cpu(cpu, msg->call_struct.waitmask); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
@@ -223,9 +223,10 @@ static inline void smp_send_message(cpumask_t callmap, unsigned long type, | |||
223 | struct ipi_message_queue *msg_queue; | 223 | struct ipi_message_queue *msg_queue; |
224 | struct ipi_message *msg; | 224 | struct ipi_message *msg; |
225 | unsigned long flags, next_msg; | 225 | unsigned long flags, next_msg; |
226 | cpumask_t waitmask = callmap; /* waitmask is shared by all cpus */ | 226 | cpumask_t waitmask; /* waitmask is shared by all cpus */ |
227 | 227 | ||
228 | for_each_cpu_mask(cpu, callmap) { | 228 | cpumask_copy(&waitmask, &callmap); |
229 | for_each_cpu(cpu, &callmap) { | ||
229 | msg_queue = &per_cpu(ipi_msg_queue, cpu); | 230 | msg_queue = &per_cpu(ipi_msg_queue, cpu); |
230 | spin_lock_irqsave(&msg_queue->lock, flags); | 231 | spin_lock_irqsave(&msg_queue->lock, flags); |
231 | if (msg_queue->count < BFIN_IPI_MSGQ_LEN) { | 232 | if (msg_queue->count < BFIN_IPI_MSGQ_LEN) { |
@@ -247,7 +248,7 @@ static inline void smp_send_message(cpumask_t callmap, unsigned long type, | |||
247 | } | 248 | } |
248 | 249 | ||
249 | if (wait) { | 250 | if (wait) { |
250 | while (!cpus_empty(waitmask)) | 251 | while (!cpumask_empty(&waitmask)) |
251 | blackfin_dcache_invalidate_range( | 252 | blackfin_dcache_invalidate_range( |
252 | (unsigned long)(&waitmask), | 253 | (unsigned long)(&waitmask), |
253 | (unsigned long)(&waitmask)); | 254 | (unsigned long)(&waitmask)); |
@@ -266,9 +267,9 @@ int smp_call_function(void (*func)(void *info), void *info, int wait) | |||
266 | cpumask_t callmap; | 267 | cpumask_t callmap; |
267 | 268 | ||
268 | preempt_disable(); | 269 | preempt_disable(); |
269 | callmap = cpu_online_map; | 270 | cpumask_copy(&callmap, cpu_online_mask); |
270 | cpu_clear(smp_processor_id(), callmap); | 271 | cpumask_clear_cpu(smp_processor_id(), &callmap); |
271 | if (!cpus_empty(callmap)) | 272 | if (!cpumask_empty(&callmap)) |
272 | smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); | 273 | smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); |
273 | 274 | ||
274 | preempt_enable(); | 275 | preempt_enable(); |
@@ -285,8 +286,8 @@ int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, | |||
285 | 286 | ||
286 | if (cpu_is_offline(cpu)) | 287 | if (cpu_is_offline(cpu)) |
287 | return 0; | 288 | return 0; |
288 | cpus_clear(callmap); | 289 | cpumask_clear(&callmap); |
289 | cpu_set(cpu, callmap); | 290 | cpumask_set_cpu(cpu, &callmap); |
290 | 291 | ||
291 | smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); | 292 | smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); |
292 | 293 | ||
@@ -309,9 +310,9 @@ void smp_send_stop(void) | |||
309 | cpumask_t callmap; | 310 | cpumask_t callmap; |
310 | 311 | ||
311 | preempt_disable(); | 312 | preempt_disable(); |
312 | callmap = cpu_online_map; | 313 | cpumask_copy(&callmap, cpu_online_mask); |
313 | cpu_clear(smp_processor_id(), callmap); | 314 | cpumask_clear_cpu(smp_processor_id(), &callmap); |
314 | if (!cpus_empty(callmap)) | 315 | if (!cpumask_empty(&callmap)) |
315 | smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); | 316 | smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); |
316 | 317 | ||
317 | preempt_enable(); | 318 | preempt_enable(); |