diff options
| -rw-r--r-- | include/asm-x86/mach-visws/mach_apicdef.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/include/asm-x86/mach-visws/mach_apicdef.h b/include/asm-x86/mach-visws/mach_apicdef.h index 826cfa97d778..e4b29ba37de6 100644 --- a/include/asm-x86/mach-visws/mach_apicdef.h +++ b/include/asm-x86/mach-visws/mach_apicdef.h | |||
| @@ -1,12 +1,24 @@ | |||
| 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 | #define APIC_ID_MASK (0xF<<24) | 4 | #include <asm/apic.h> |
| 5 | 5 | ||
| 6 | static inline unsigned get_apic_id(unsigned long x) | 6 | #ifdef CONFIG_X86_64 |
| 7 | #define APIC_ID_MASK (0xFFu<<24) | ||
| 8 | #define GET_APIC_ID(x) (((x)>>24)&0xFFu) | ||
| 9 | #define SET_APIC_ID(x) (((x)<<24)) | ||
| 10 | #else | ||
| 11 | #define APIC_ID_MASK (0xF<<24) | ||
| 12 | static inline unsigned get_apic_id(unsigned long x) | ||
| 7 | { | 13 | { |
| 8 | return (((x)>>24)&0xF); | 14 | unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); |
| 9 | } | 15 | if (APIC_XAPIC(ver)) |
| 10 | #define GET_APIC_ID(x) get_apic_id(x) | 16 | return (((x)>>24)&0xFF); |
| 17 | else | ||
| 18 | return (((x)>>24)&0xF); | ||
| 19 | } | ||
| 20 | |||
| 21 | #define GET_APIC_ID(x) get_apic_id(x) | ||
| 22 | #endif | ||
| 11 | 23 | ||
| 12 | #endif | 24 | #endif |
