diff options
author | Mike Travis <travis@sgi.com> | 2008-12-16 20:33:54 -0500 |
---|---|---|
committer | Mike Travis <travis@sgi.com> | 2008-12-16 20:40:56 -0500 |
commit | 95d313cf1c1ecedc8bec5727b09bdacbf67dfc45 (patch) | |
tree | ee4aa8aff232bb30bb725c5670bb67d73484022d /arch/x86/kernel/genx2apic_uv_x.c | |
parent | a1681965011916c2f1f0f1f87e70784f5d5d5be5 (diff) |
x86: Add cpu_mask_to_apicid_and
Impact: new API
Add a helper function that takes two cpumask's, and's them and then
returns the apicid of the result. This removes a need in io_apic.c
that uses a temporary cpumask to hold (mask & cfg->domain).
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'arch/x86/kernel/genx2apic_uv_x.c')
-rw-r--r-- | arch/x86/kernel/genx2apic_uv_x.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c index 010659415ae..53bd2570272 100644 --- a/arch/x86/kernel/genx2apic_uv_x.c +++ b/arch/x86/kernel/genx2apic_uv_x.c | |||
@@ -179,6 +179,21 @@ static unsigned int uv_cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
179 | return BAD_APICID; | 179 | return BAD_APICID; |
180 | } | 180 | } |
181 | 181 | ||
182 | static unsigned int uv_cpu_mask_to_apicid_and(const cpumask_t *cpumask, | ||
183 | const cpumask_t *andmask) | ||
184 | { | ||
185 | int cpu; | ||
186 | |||
187 | /* | ||
188 | * We're using fixed IRQ delivery, can only return one phys APIC ID. | ||
189 | * May as well be the first. | ||
190 | */ | ||
191 | while ((cpu = next_cpu(-1, *cpumask)) < nr_cpu_ids) | ||
192 | if (cpu_isset(cpu, *andmask)) | ||
193 | return per_cpu(x86_cpu_to_apicid, cpu); | ||
194 | return BAD_APICID; | ||
195 | } | ||
196 | |||
182 | static unsigned int get_apic_id(unsigned long x) | 197 | static unsigned int get_apic_id(unsigned long x) |
183 | { | 198 | { |
184 | unsigned int id; | 199 | unsigned int id; |
@@ -229,6 +244,7 @@ struct genapic apic_x2apic_uv_x = { | |||
229 | .send_IPI_mask_allbutself = uv_send_IPI_mask_allbutself, | 244 | .send_IPI_mask_allbutself = uv_send_IPI_mask_allbutself, |
230 | .send_IPI_self = uv_send_IPI_self, | 245 | .send_IPI_self = uv_send_IPI_self, |
231 | .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, | 246 | .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, |
247 | .cpu_mask_to_apicid_and = uv_cpu_mask_to_apicid_and, | ||
232 | .phys_pkg_id = phys_pkg_id, | 248 | .phys_pkg_id = phys_pkg_id, |
233 | .get_apic_id = get_apic_id, | 249 | .get_apic_id = get_apic_id, |
234 | .set_apic_id = set_apic_id, | 250 | .set_apic_id = set_apic_id, |