aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/x2apic_phys.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/x2apic_phys.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/x2apic_phys.c')
-rw-r--r--arch/x86/kernel/apic/x2apic_phys.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index b1a8b39e3c3..f730269edef 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -76,38 +76,6 @@ static void x2apic_send_IPI_all(int vector)
76 __x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLINC); 76 __x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLINC);
77} 77}
78 78
79static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
80{
81 /*
82 * We're using fixed IRQ delivery, can only return one phys APIC ID.
83 * May as well be the first.
84 */
85 int cpu = cpumask_first(cpumask);
86
87 if ((unsigned)cpu < nr_cpu_ids)
88 return per_cpu(x86_cpu_to_apicid, cpu);
89 else
90 return BAD_APICID;
91}
92
93static unsigned int
94x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
95 const struct cpumask *andmask)
96{
97 int cpu;
98
99 /*
100 * We're using fixed IRQ delivery, can only return one phys APIC ID.
101 * May as well be the first.
102 */
103 for_each_cpu_and(cpu, cpumask, andmask) {
104 if (cpumask_test_cpu(cpu, cpu_online_mask))
105 break;
106 }
107
108 return per_cpu(x86_cpu_to_apicid, cpu);
109}
110
111static void init_x2apic_ldr(void) 79static void init_x2apic_ldr(void)
112{ 80{
113} 81}
@@ -164,8 +132,8 @@ static struct apic apic_x2apic_phys = {
164 .set_apic_id = x2apic_set_apic_id, 132 .set_apic_id = x2apic_set_apic_id,
165 .apic_id_mask = 0xFFFFFFFFu, 133 .apic_id_mask = 0xFFFFFFFFu,
166 134
167 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, 135 .cpu_mask_to_apicid = default_cpu_mask_to_apicid,
168 .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and, 136 .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and,
169 137
170 .send_IPI_mask = x2apic_send_IPI_mask, 138 .send_IPI_mask = x2apic_send_IPI_mask,
171 .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself, 139 .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself,