aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
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/kernel
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/kernel')
-rw-r--r--arch/x86/kernel/genapic_flat_64.c21
-rw-r--r--arch/x86/kernel/genx2apic_cluster.c10
-rw-r--r--arch/x86/kernel/genx2apic_phys.c10
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c10
4 files changed, 26 insertions, 25 deletions
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index 1efecd206a74..c772bb10b173 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -158,13 +158,13 @@ static unsigned int flat_cpu_mask_to_apicid(const cpumask_t *cpumask)
158 return cpus_addr(*cpumask)[0] & APIC_ALL_CPUS; 158 return cpus_addr(*cpumask)[0] & APIC_ALL_CPUS;
159} 159}
160 160
161static unsigned int flat_cpu_mask_to_apicid_and(const cpumask_t *cpumask, 161static unsigned int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
162 const cpumask_t *andmask) 162 const struct cpumask *andmask)
163{ 163{
164 unsigned long mask1 = cpus_addr(*cpumask)[0] & APIC_ALL_CPUS; 164 unsigned long mask1 = cpumask_bits(cpumask)[0] & APIC_ALL_CPUS;
165 unsigned long mask2 = cpus_addr(*andmask)[0] & APIC_ALL_CPUS; 165 unsigned long mask2 = cpumask_bits(andmask)[0] & APIC_ALL_CPUS;
166 166
167 return (int)(mask1 & mask2); 167 return mask1 & mask2;
168} 168}
169 169
170static unsigned int phys_pkg_id(int index_msb) 170static unsigned int phys_pkg_id(int index_msb)
@@ -264,8 +264,9 @@ static unsigned int physflat_cpu_mask_to_apicid(const cpumask_t *cpumask)
264 return BAD_APICID; 264 return BAD_APICID;
265} 265}
266 266
267static unsigned int physflat_cpu_mask_to_apicid_and(const cpumask_t *cpumask, 267static unsigned int
268 const cpumask_t *andmask) 268physflat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
269 const struct cpumask *andmask)
269{ 270{
270 int cpu; 271 int cpu;
271 272
@@ -273,9 +274,9 @@ static unsigned int physflat_cpu_mask_to_apicid_and(const cpumask_t *cpumask,
273 * We're using fixed IRQ delivery, can only return one phys APIC ID. 274 * We're using fixed IRQ delivery, can only return one phys APIC ID.
274 * May as well be the first. 275 * May as well be the first.
275 */ 276 */
276 while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) 277 cpu = cpumask_any_and(cpumask, andmask);
277 if (cpu_isset(cpu, *andmask)) 278 if (cpu < nr_cpu_ids)
278 return per_cpu(x86_cpu_to_apicid, cpu); 279 return per_cpu(x86_cpu_to_apicid, cpu);
279 return BAD_APICID; 280 return BAD_APICID;
280} 281}
281 282
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index fd8047f4e455..e7d16f53b9cd 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -123,8 +123,8 @@ static unsigned int x2apic_cpu_mask_to_apicid(const cpumask_t *cpumask)
123 return BAD_APICID; 123 return BAD_APICID;
124} 124}
125 125
126static unsigned int x2apic_cpu_mask_to_apicid_and(const cpumask_t *cpumask, 126static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
127 const cpumask_t *andmask) 127 const struct cpumask *andmask)
128{ 128{
129 int cpu; 129 int cpu;
130 130
@@ -132,9 +132,9 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const cpumask_t *cpumask,
132 * We're using fixed IRQ delivery, can only return one phys APIC ID. 132 * We're using fixed IRQ delivery, can only return one phys APIC ID.
133 * May as well be the first. 133 * May as well be the first.
134 */ 134 */
135 while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) 135 cpu = cpumask_any_and(cpumask, andmask);
136 if (cpu_isset(cpu, *andmask)) 136 if (cpu < nr_cpu_ids)
137 return per_cpu(x86_cpu_to_apicid, cpu); 137 return per_cpu(x86_cpu_to_apicid, cpu);
138 return BAD_APICID; 138 return BAD_APICID;
139} 139}
140 140
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index d5578bb8f165..9d0386c7e798 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -122,8 +122,8 @@ static unsigned int x2apic_cpu_mask_to_apicid(const cpumask_t *cpumask)
122 return BAD_APICID; 122 return BAD_APICID;
123} 123}
124 124
125static unsigned int x2apic_cpu_mask_to_apicid_and(const cpumask_t *cpumask, 125static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
126 const cpumask_t *andmask) 126 const struct cpumask *andmask)
127{ 127{
128 int cpu; 128 int cpu;
129 129
@@ -131,9 +131,9 @@ static unsigned int x2apic_cpu_mask_to_apicid_and(const cpumask_t *cpumask,
131 * We're using fixed IRQ delivery, can only return one phys APIC ID. 131 * We're using fixed IRQ delivery, can only return one phys APIC ID.
132 * May as well be the first. 132 * May as well be the first.
133 */ 133 */
134 while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) 134 cpu = cpumask_any_and(cpumask, andmask);
135 if (cpu_isset(cpu, *andmask)) 135 if (cpu < nr_cpu_ids)
136 return per_cpu(x86_cpu_to_apicid, cpu); 136 return per_cpu(x86_cpu_to_apicid, cpu);
137 return BAD_APICID; 137 return BAD_APICID;
138} 138}
139 139
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 53bd2570272c..22596ec94c82 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -179,8 +179,8 @@ static unsigned int uv_cpu_mask_to_apicid(const cpumask_t *cpumask)
179 return BAD_APICID; 179 return BAD_APICID;
180} 180}
181 181
182static unsigned int uv_cpu_mask_to_apicid_and(const cpumask_t *cpumask, 182static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
183 const cpumask_t *andmask) 183 const struct cpumask *andmask)
184{ 184{
185 int cpu; 185 int cpu;
186 186
@@ -188,9 +188,9 @@ static unsigned int uv_cpu_mask_to_apicid_and(const cpumask_t *cpumask,
188 * We're using fixed IRQ delivery, can only return one phys APIC ID. 188 * We're using fixed IRQ delivery, can only return one phys APIC ID.
189 * May as well be the first. 189 * May as well be the first.
190 */ 190 */
191 while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) 191 cpu = cpumask_any_and(cpumask, andmask);
192 if (cpu_isset(cpu, *andmask)) 192 if (cpu < nr_cpu_ids)
193 return per_cpu(x86_cpu_to_apicid, cpu); 193 return per_cpu(x86_cpu_to_apicid, cpu);
194 return BAD_APICID; 194 return BAD_APICID;
195} 195}
196 196