aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/bigsmp_32.c
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@redhat.com>2012-06-05 07:23:44 -0400
committerIngo Molnar <mingo@kernel.org>2012-06-06 04:22:18 -0400
commit6398268d2bc454735f11e08705e858f9fdf5c750 (patch)
treef6b430e540f1a5da11b371d450d3262550a330b0 /arch/x86/kernel/apic/bigsmp_32.c
parentbf721d3a3bc7a731add45c8078b142b494ab413e (diff)
x86/apic: Factor out default cpu_mask_to_apicid() operations
Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/20120605112340.GA11454@dhcp-26-207.brq.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/apic/bigsmp_32.c')
-rw-r--r--arch/x86/kernel/apic/bigsmp_32.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
index c288e81e00ff..907aa3d112a6 100644
--- a/arch/x86/kernel/apic/bigsmp_32.c
+++ b/arch/x86/kernel/apic/bigsmp_32.c
@@ -96,32 +96,6 @@ static int bigsmp_check_phys_apicid_present(int phys_apicid)
96 return 1; 96 return 1;
97} 97}
98 98
99/* As we are using single CPU as destination, pick only one CPU here */
100static unsigned int bigsmp_cpu_mask_to_apicid(const struct cpumask *cpumask)
101{
102 int cpu = cpumask_first(cpumask);
103
104 if (cpu < nr_cpu_ids)
105 return cpu_physical_id(cpu);
106 return BAD_APICID;
107}
108
109static unsigned int bigsmp_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
110 const struct cpumask *andmask)
111{
112 int cpu;
113
114 /*
115 * We're using fixed IRQ delivery, can only return one phys APIC ID.
116 * May as well be the first.
117 */
118 for_each_cpu_and(cpu, cpumask, andmask) {
119 if (cpumask_test_cpu(cpu, cpu_online_mask))
120 return cpu_physical_id(cpu);
121 }
122 return BAD_APICID;
123}
124
125static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb) 99static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
126{ 100{
127 return cpuid_apic >> index_msb; 101 return cpuid_apic >> index_msb;
@@ -220,8 +194,8 @@ static struct apic apic_bigsmp = {
220 .set_apic_id = NULL, 194 .set_apic_id = NULL,
221 .apic_id_mask = 0xFF << 24, 195 .apic_id_mask = 0xFF << 24,
222 196
223 .cpu_mask_to_apicid = bigsmp_cpu_mask_to_apicid, 197 .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
224 .cpu_mask_to_apicid_and = bigsmp_cpu_mask_to_apicid_and, 198 .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
225 199
226 .send_IPI_mask = bigsmp_send_IPI_mask, 200 .send_IPI_mask = bigsmp_send_IPI_mask,
227 .send_IPI_mask_allbutself = NULL, 201 .send_IPI_mask_allbutself = NULL,