diff options
author | Mike Travis <travis@sgi.com> | 2008-12-16 20:33:55 -0500 |
---|---|---|
committer | Mike Travis <travis@sgi.com> | 2008-12-16 20:40:56 -0500 |
commit | 6eeb7c5a99434596c5953a95baa17d2f085664e3 (patch) | |
tree | 30fd0b08b0a427b953beaf92927468bf86fad956 /arch/x86/include/asm/summit/apic.h | |
parent | 95d313cf1c1ecedc8bec5727b09bdacbf67dfc45 (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/summit/apic.h')
-rw-r--r-- | arch/x86/include/asm/summit/apic.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h index cbcc2c7eb1d5..651a93849341 100644 --- a/arch/x86/include/asm/summit/apic.h +++ b/arch/x86/include/asm/summit/apic.h | |||
@@ -170,8 +170,8 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
170 | return apicid; | 170 | return apicid; |
171 | } | 171 | } |
172 | 172 | ||
173 | static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | 173 | static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask, |
174 | const cpumask_t *andmask) | 174 | const struct cpumask *andmask) |
175 | { | 175 | { |
176 | int num_bits_set; | 176 | int num_bits_set; |
177 | int num_bits_set2; | 177 | int num_bits_set2; |
@@ -179,9 +179,9 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | |||
179 | int cpu; | 179 | int cpu; |
180 | int apicid = 0; | 180 | int apicid = 0; |
181 | 181 | ||
182 | num_bits_set = cpus_weight(*cpumask); | 182 | num_bits_set = cpumask_weight(cpumask); |
183 | num_bits_set2 = cpus_weight(*andmask); | 183 | num_bits_set2 = cpumask_weight(andmask); |
184 | num_bits_set = min_t(int, num_bits_set, num_bits_set2); | 184 | num_bits_set = min(num_bits_set, num_bits_set2); |
185 | /* Return id to all */ | 185 | /* Return id to all */ |
186 | if (num_bits_set >= nr_cpu_ids) | 186 | if (num_bits_set >= nr_cpu_ids) |
187 | return 0xFF; | 187 | return 0xFF; |
@@ -189,11 +189,11 @@ static inline unsigned int cpu_mask_to_apicid_and(const cpumask_t *cpumask, | |||
189 | * The cpus in the mask must all be on the apic cluster. If are not | 189 | * The cpus in the mask must all be on the apic cluster. If are not |
190 | * on the same apicid cluster return default value of TARGET_CPUS. | 190 | * on the same apicid cluster return default value of TARGET_CPUS. |
191 | */ | 191 | */ |
192 | while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) | 192 | cpu = cpumask_first_and(cpumask, andmask); |
193 | if (cpu_isset(cpu, *andmask) | 193 | apicid = cpu_to_logical_apicid(cpu); |
194 | apicid = cpu_to_logical_apicid(cpu); | ||
195 | while (cpus_found < num_bits_set) { | 194 | while (cpus_found < num_bits_set) { |
196 | if (cpu_isset(cpu, *cpumask) && cpu_isset(cpu, *andmask)) { | 195 | if (cpumask_test_cpu(cpu, cpumask) |
196 | && cpumask_test_cpu(cpu, andmask)) { | ||
197 | int new_apicid = cpu_to_logical_apicid(cpu); | 197 | int new_apicid = cpu_to_logical_apicid(cpu); |
198 | if (apicid_cluster(apicid) != | 198 | if (apicid_cluster(apicid) != |
199 | apicid_cluster(new_apicid)) { | 199 | apicid_cluster(new_apicid)) { |