summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/apic.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 17:36:56 +0100
committerIngo Molnar <mingo@elte.hu>2009-01-28 23:20:36 +0100
commit1f75ed0c1311a50ed393bcac258de65680d360e5 (patch)
treea01ba549ce874af2167543aa91769bfedd508220 /arch/x86/include/asm/apic.h
parentx86: remove mach_mpspec.h (diff)
downloadlinux-1f75ed0c1311a50ed393bcac258de65680d360e5.tar.xz
linux-1f75ed0c1311a50ed393bcac258de65680d360e5.zip
x86: remove mach_apicdef.h
Move its definitions into apic.h. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/apic.h')
-rw-r--r--arch/x86/include/asm/apic.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index e8f030440bc7..3a3202074c63 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -211,4 +211,20 @@ static inline void disable_local_APIC(void) { }
#endif /* !CONFIG_X86_LOCAL_APIC */
+#ifdef CONFIG_X86_64
+#define SET_APIC_ID(x) (apic->set_apic_id(x))
+#else
+
+static inline unsigned default_get_apic_id(unsigned long x)
+{
+ unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
+
+ if (APIC_XAPIC(ver))
+ return (x >> 24) & 0xFF;
+ else
+ return (x >> 24) & 0x0F;
+}
+
+#endif
+
#endif /* _ASM_X86_APIC_H */