diff options
-rw-r--r-- | include/asm-x86/mach-default/mach_apicdef.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-x86/mach-default/mach_apicdef.h b/include/asm-x86/mach-default/mach_apicdef.h index 7bcb350c3ee8..ae9841319094 100644 --- a/include/asm-x86/mach-default/mach_apicdef.h +++ b/include/asm-x86/mach-default/mach_apicdef.h | |||
@@ -1,11 +1,17 @@ | |||
1 | #ifndef __ASM_MACH_APICDEF_H | 1 | #ifndef __ASM_MACH_APICDEF_H |
2 | #define __ASM_MACH_APICDEF_H | 2 | #define __ASM_MACH_APICDEF_H |
3 | 3 | ||
4 | #include <asm/apic.h> | ||
5 | |||
4 | #define APIC_ID_MASK (0xF<<24) | 6 | #define APIC_ID_MASK (0xF<<24) |
5 | 7 | ||
6 | static inline unsigned get_apic_id(unsigned long x) | 8 | static inline unsigned get_apic_id(unsigned long x) |
7 | { | 9 | { |
8 | return (((x)>>24)&0xF); | 10 | unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); |
11 | if (APIC_XAPIC(ver)) | ||
12 | return (((x)>>24)&0xFF); | ||
13 | else | ||
14 | return (((x)>>24)&0xF); | ||
9 | } | 15 | } |
10 | 16 | ||
11 | #define GET_APIC_ID(x) get_apic_id(x) | 17 | #define GET_APIC_ID(x) get_apic_id(x) |