aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/x2apic_phys.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2011-05-19 19:45:50 -0400
committerIngo Molnar <mingo@elte.hu>2011-05-20 07:41:11 -0400
commit79deb8e511bd6fc8e40add4da75b19df085d9453 (patch)
tree6deaa403173d0501ee497237bea2e6e3f6e7cfe5 /arch/x86/kernel/apic/x2apic_phys.c
parent9d0fa6c5f43f2d9c6966dcab7af96a717682fdec (diff)
x86, x2apic: Move the common bits to x2apic.h
To eliminate code duplication. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: steiner@sgi.com Cc: yinghai@kernel.org Link: http://lkml.kernel.org/r/20110519234637.591426753@sbsiddha-MOBL3.sc.intel.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic/x2apic_phys.c')
-rw-r--r--arch/x86/kernel/apic/x2apic_phys.c60
1 files changed, 3 insertions, 57 deletions
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 6ef49e338a73..78c8f33a09fa 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -7,8 +7,7 @@
7#include <linux/dmar.h> 7#include <linux/dmar.h>
8 8
9#include <asm/smp.h> 9#include <asm/smp.h>
10#include <asm/apic.h> 10#include <asm/x2apic.h>
11#include <asm/ipi.h>
12 11
13int x2apic_phys; 12int x2apic_phys;
14 13
@@ -27,34 +26,6 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
27 return 0; 26 return 0;
28} 27}
29 28
30/*
31 * need to use more than cpu 0, because we need more vectors when
32 * MSI-X are used.
33 */
34static const struct cpumask *x2apic_target_cpus(void)
35{
36 return cpu_online_mask;
37}
38
39static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
40{
41 cpumask_clear(retmask);
42 cpumask_set_cpu(cpu, retmask);
43}
44
45static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
46 unsigned int dest)
47{
48 unsigned long cfg;
49
50 cfg = __prepare_ICR(0, vector, dest);
51
52 /*
53 * send the IPI.
54 */
55 native_x2apic_icr_write(cfg, apicid);
56}
57
58static void 29static void
59__x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest) 30__x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
60{ 31{
@@ -97,11 +68,6 @@ static void x2apic_send_IPI_all(int vector)
97 __x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLINC); 68 __x2apic_send_IPI_mask(cpu_online_mask, vector, APIC_DEST_ALLINC);
98} 69}
99 70
100static int x2apic_apic_id_registered(void)
101{
102 return 1;
103}
104
105static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask) 71static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
106{ 72{
107 /* 73 /*
@@ -134,26 +100,6 @@ x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
134 return per_cpu(x86_cpu_to_apicid, cpu); 100 return per_cpu(x86_cpu_to_apicid, cpu);
135} 101}
136 102
137static unsigned int x2apic_phys_get_apic_id(unsigned long x)
138{
139 return x;
140}
141
142static unsigned long set_apic_id(unsigned int id)
143{
144 return id;
145}
146
147static int x2apic_phys_pkg_id(int initial_apicid, int index_msb)
148{
149 return initial_apicid >> index_msb;
150}
151
152static void x2apic_send_IPI_self(int vector)
153{
154 apic_write(APIC_SELF_IPI, vector);
155}
156
157static void init_x2apic_ldr(void) 103static void init_x2apic_ldr(void)
158{ 104{
159} 105}
@@ -196,8 +142,8 @@ struct apic apic_x2apic_phys = {
196 .phys_pkg_id = x2apic_phys_pkg_id, 142 .phys_pkg_id = x2apic_phys_pkg_id,
197 .mps_oem_check = NULL, 143 .mps_oem_check = NULL,
198 144
199 .get_apic_id = x2apic_phys_get_apic_id, 145 .get_apic_id = x2apic_get_apic_id,
200 .set_apic_id = set_apic_id, 146 .set_apic_id = x2apic_set_apic_id,
201 .apic_id_mask = 0xFFFFFFFFu, 147 .apic_id_mask = 0xFFFFFFFFu,
202 148
203 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, 149 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid,