7b78275e6d33d270608b1480e127614da7472bd3
[sfrench/cifs-2.6.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 SET_APIC_ID(x)          (((x)<<24))
9 #else
10 #define         APIC_ID_MASK            (0xF<<24)
11 #endif
12
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
24 #endif