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 | |
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')
-rw-r--r-- | arch/blackfin/kernel/nmi.c | 8 | ||||
-rw-r--r-- | arch/blackfin/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/blackfin/mach-common/dpmc.c | 7 | ||||
-rw-r--r-- | arch/blackfin/mach-common/smp.c | 27 |
4 files changed, 24 insertions, 22 deletions
diff --git a/arch/blackfin/kernel/nmi.c b/arch/blackfin/kernel/nmi.c index 401eb1d8e3b4..679d0db35256 100644 --- a/arch/blackfin/kernel/nmi.c +++ b/arch/blackfin/kernel/nmi.c | |||
@@ -145,16 +145,16 @@ int check_nmi_wdt_touched(void) | |||
145 | { | 145 | { |
146 | unsigned int this_cpu = smp_processor_id(); | 146 | unsigned int this_cpu = smp_processor_id(); |
147 | unsigned int cpu; | 147 | unsigned int cpu; |
148 | cpumask_t mask; | ||
148 | 149 | ||
149 | cpumask_t mask = cpu_online_map; | 150 | cpumask_copy(&mask, cpu_online_mask); |
150 | |||
151 | if (!atomic_read(&nmi_touched[this_cpu])) | 151 | if (!atomic_read(&nmi_touched[this_cpu])) |
152 | return 0; | 152 | return 0; |
153 | 153 | ||
154 | atomic_set(&nmi_touched[this_cpu], 0); | 154 | atomic_set(&nmi_touched[this_cpu], 0); |
155 | 155 | ||
156 | cpu_clear(this_cpu, mask); | 156 | cpumask_clear_cpu(this_cpu, &mask); |
157 | for_each_cpu_mask(cpu, mask) { | 157 | for_each_cpu(cpu, &mask) { |
158 | invalidate_dcache_range((unsigned long)(&nmi_touched[cpu]), | 158 | invalidate_dcache_range((unsigned long)(&nmi_touched[cpu]), |
159 | (unsigned long)(&nmi_touched[cpu])); | 159 | (unsigned long)(&nmi_touched[cpu])); |
160 | if (!atomic_read(&nmi_touched[cpu])) | 160 | if (!atomic_read(&nmi_touched[cpu])) |
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 2f48f03c634e..536bd9d7e0cf 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
@@ -1324,7 +1324,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1324 | static void *c_start(struct seq_file *m, loff_t *pos) | 1324 | static void *c_start(struct seq_file *m, loff_t *pos) |
1325 | { | 1325 | { |
1326 | if (*pos == 0) | 1326 | if (*pos == 0) |
1327 | *pos = first_cpu(cpu_online_map); | 1327 | *pos = cpumask_first(cpu_online_mask); |
1328 | if (*pos >= num_online_cpus()) | 1328 | if (*pos >= num_online_cpus()) |
1329 | return NULL; | 1329 | return NULL; |
1330 | 1330 | ||
@@ -1333,7 +1333,7 @@ static void *c_start(struct seq_file *m, loff_t *pos) | |||
1333 | 1333 | ||
1334 | static void *c_next(struct seq_file *m, void *v, loff_t *pos) | 1334 | static void *c_next(struct seq_file *m, void *v, loff_t *pos) |
1335 | { | 1335 | { |
1336 | *pos = next_cpu(*pos, cpu_online_map); | 1336 | *pos = cpumask_next(*pos, cpu_online_mask); |
1337 | 1337 | ||
1338 | return c_start(m, pos); | 1338 | return c_start(m, pos); |
1339 | } | 1339 | } |
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(); |