aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/es7000/apic.h
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-12-16 20:33:55 -0500
committerMike Travis <travis@sgi.com>2008-12-16 20:40:56 -0500
commit6eeb7c5a99434596c5953a95baa17d2f085664e3 (patch)
tree30fd0b08b0a427b953beaf92927468bf86fad956 /arch/x86/include/asm/es7000/apic.h
parent95d313cf1c1ecedc8bec5727b09bdacbf67dfc45 (diff)
x86: update add-cpu_mask_to_apicid_and to use struct cpumask*
Impact: use updated APIs Various API updates for x86:add-cpu_mask_to_apicid_and (Note: separate because previous patch has been "backported" to 2.6.27.) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'arch/x86/include/asm/es7000/apic.h')
-rw-r--r--arch/x86/include/asm/es7000/apic.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index c2bed772af8..ba8423c5363 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -214,8 +214,8 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
214 return apicid; 214 return apicid;
215} 215}
216 216
217static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, 217static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
218 const cpumask_t *andmask) 218 const struct cpumask *andmask)
219{ 219{
220 int num_bits_set; 220 int num_bits_set;
221 int num_bits_set2; 221 int num_bits_set2;
@@ -223,9 +223,9 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask,
223 int cpu; 223 int cpu;
224 int apicid = 0; 224 int apicid = 0;
225 225
226 num_bits_set = cpus_weight(*cpumask); 226 num_bits_set = cpumask_weight(cpumask);
227 num_bits_set2 = cpus_weight(*andmask); 227 num_bits_set2 = cpumask_weight(andmask);
228 num_bits_set = min_t(int, num_bits_set, num_bits_set2); 228 num_bits_set = min(num_bits_set, num_bits_set2);
229 /* Return id to all */ 229 /* Return id to all */
230 if (num_bits_set >= nr_cpu_ids) 230 if (num_bits_set >= nr_cpu_ids)
231#if defined CONFIG_ES7000_CLUSTERED_APIC 231#if defined CONFIG_ES7000_CLUSTERED_APIC
@@ -237,11 +237,12 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask,
237 * The cpus in the mask must all be on the apic cluster. If are not 237 * The cpus in the mask must all be on the apic cluster. If are not
238 * on the same apicid cluster return default value of TARGET_CPUS. 238 * on the same apicid cluster return default value of TARGET_CPUS.
239 */ 239 */
240 while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) 240 cpu = cpumask_first_and(cpumask, andmask);
241 if (cpu_isset(cpu, *andmask) 241 apicid = cpu_to_logical_apicid(cpu);
242 apicid = cpu_to_logical_apicid(cpu); 242
243 while (cpus_found < num_bits_set) { 243 while (cpus_found < num_bits_set) {
244 if (cpu_isset(cpu, *cpumask) && cpu_isset(cpu, *andmask)) { 244 if (cpumask_test_cpu(cpu, cpumask) &&
245 cpumask_test_cpu(cpu, andmask)) {
245 int new_apicid = cpu_to_logical_apicid(cpu); 246 int new_apicid = cpu_to_logical_apicid(cpu);
246 if (apicid_cluster(apicid) != 247 if (apicid_cluster(apicid) !=
247 apicid_cluster(new_apicid)) { 248 apicid_cluster(new_apicid)) {