]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-x86/mach-default/mach_apicdef.h
x64, x2apic/intr-remap: introduce read_apic_id() to genapic routines
[linux-2.6-omap-h63xx.git] / include / asm-x86 / mach-default / mach_apicdef.h
1 #ifndef __ASM_MACH_APICDEF_H
2 #define __ASM_MACH_APICDEF_H
3
4 #include <asm/apic.h>
5
6 #ifdef CONFIG_X86_64
7 #define APIC_ID_MASK            (0xFFu<<24)
8 #define GET_APIC_ID(x)          (x)
9 #define SET_APIC_ID(x)          (((x)<<24))
10 #define GET_XAPIC_ID(x)         (((x) >> 24) & 0xFFu)
11 #else
12 #define         APIC_ID_MASK            (0xF<<24)
13 static inline unsigned get_apic_id(unsigned long x) 
14 {
15         unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
16         if (APIC_XAPIC(ver))
17                 return (((x)>>24)&0xFF);
18         else
19                 return (((x)>>24)&0xF);
20
21
22 #define         GET_APIC_ID(x)  get_apic_id(x)
23 #endif
24
25 #endif