aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/genx2apic_uv_x.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2008-07-10 14:16:48 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-12 02:44:57 -0400
commit0c81c746f9bdbfaafe64322d540c8b7b59c27314 (patch)
tree2f6a291a7b699b930e617909f3476dfafb5a38bb /arch/x86/kernel/genx2apic_uv_x.c
parent4dc2f96cacd1e74c688f94348a3bfd0a980817d5 (diff)
x64, x2apic/intr-remap: introduce read_apic_id() to genapic routines
Move the read_apic_id() to genapic routines. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: akpm@linux-foundation.org Cc: arjan@linux.intel.com Cc: andi@firstfloor.org Cc: ebiederm@xmission.com Cc: jbarnes@virtuousgeek.org Cc: steiner@sgi.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/genx2apic_uv_x.c')
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 711f11c30b06..1ef99be18488 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -18,6 +18,7 @@
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <linux/bootmem.h> 19#include <linux/bootmem.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/hardirq.h>
21#include <asm/smp.h> 22#include <asm/smp.h>
22#include <asm/ipi.h> 23#include <asm/ipi.h>
23#include <asm/genapic.h> 24#include <asm/genapic.h>
@@ -134,9 +135,19 @@ static unsigned int uv_cpu_mask_to_apicid(cpumask_t cpumask)
134 return BAD_APICID; 135 return BAD_APICID;
135} 136}
136 137
138static unsigned int uv_read_apic_id(void)
139{
140 unsigned int id;
141
142 WARN_ON(preemptible() && num_online_cpus() > 1);
143 id = apic_read(APIC_ID) | __get_cpu_var(x2apic_extra_bits);
144
145 return id;
146}
147
137static unsigned int phys_pkg_id(int index_msb) 148static unsigned int phys_pkg_id(int index_msb)
138{ 149{
139 return GET_APIC_ID(read_apic_id()) >> index_msb; 150 return uv_read_apic_id() >> index_msb;
140} 151}
141 152
142#ifdef ZZZ /* Needs x2apic patch */ 153#ifdef ZZZ /* Needs x2apic patch */
@@ -159,6 +170,7 @@ struct genapic apic_x2apic_uv_x = {
159 /* ZZZ.send_IPI_self = uv_send_IPI_self, */ 170 /* ZZZ.send_IPI_self = uv_send_IPI_self, */
160 .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, 171 .cpu_mask_to_apicid = uv_cpu_mask_to_apicid,
161 .phys_pkg_id = phys_pkg_id, /* Fixme ZZZ */ 172 .phys_pkg_id = phys_pkg_id, /* Fixme ZZZ */
173 .read_apic_id = uv_read_apic_id,
162}; 174};
163 175
164static __cpuinit void set_x2apic_extra_bits(int pnode) 176static __cpuinit void set_x2apic_extra_bits(int pnode)