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/include/asm/mach-default | |
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/include/asm/mach-default')
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apic.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h index c18896b0508c..229b605d104e 100644 --- a/arch/x86/include/asm/mach-default/mach_apic.h +++ b/arch/x86/include/asm/mach-default/mach_apic.h | |||
@@ -28,6 +28,7 @@ static inline const cpumask_t *target_cpus(void) | |||
28 | #define apic_id_registered (genapic->apic_id_registered) | 28 | #define apic_id_registered (genapic->apic_id_registered) |
29 | #define init_apic_ldr (genapic->init_apic_ldr) | 29 | #define init_apic_ldr (genapic->init_apic_ldr) |
30 | #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) | 30 | #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) |
31 | #define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and) | ||
31 | #define phys_pkg_id (genapic->phys_pkg_id) | 32 | #define phys_pkg_id (genapic->phys_pkg_id) |
32 | #define vector_allocation_domain (genapic->vector_allocation_domain) | 33 | #define vector_allocation_domain (genapic->vector_allocation_domain) |
33 | #define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID))) | 34 | #define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID))) |
@@ -66,6 +67,15 @@ static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask) | |||
66 | return cpus_addr(*cpumask)[0]; | 67 | return cpus_addr(*cpumask)[0]; |
67 | } | 68 | } |
68 | 69 | ||
70 | static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask, | ||
71 | const cpumask_t *andmask) | ||
72 | { | ||
73 | unsigned long mask1 = cpus_addr(*cpumask)[0]; | ||
74 | unsigned long mask2 = cpus_addr(*andmask)[0]; | ||
75 | |||
76 | return (unsigned int)(mask1 & mask2); | ||
77 | } | ||
78 | |||
69 | static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) | 79 | static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) |
70 | { | 80 | { |
71 | return cpuid_apic >> index_msb; | 81 | return cpuid_apic >> index_msb; |