diff options
Diffstat (limited to 'arch/x86/include/asm/mach-default/mach_apicdef.h')
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apicdef.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h new file mode 100644 index 000000000000..0c2d41c41b20 --- /dev/null +++ b/arch/x86/include/asm/mach-default/mach_apicdef.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef ASM_X86__MACH_DEFAULT__MACH_APICDEF_H | ||
2 | #define ASM_X86__MACH_DEFAULT__MACH_APICDEF_H | ||
3 | |||
4 | #include <asm/apic.h> | ||
5 | |||
6 | #ifdef CONFIG_X86_64 | ||
7 | #define APIC_ID_MASK (genapic->apic_id_mask) | ||
8 | #define GET_APIC_ID(x) (genapic->get_apic_id(x)) | ||
9 | #define SET_APIC_ID(x) (genapic->set_apic_id(x)) | ||
10 | #else | ||
11 | #define APIC_ID_MASK (0xF<<24) | ||
12 | static inline unsigned get_apic_id(unsigned long x) | ||
13 | { | ||
14 | unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); | ||
15 | if (APIC_XAPIC(ver)) | ||
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 | ||
23 | |||
24 | #endif /* ASM_X86__MACH_DEFAULT__MACH_APICDEF_H */ | ||