Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef __ASM_MACH_APICDEF_H |
2 | #define __ASM_MACH_APICDEF_H | |
3 | ||
b70d9c24 | 4 | #include <asm/apic.h> |
1da177e4 | 5 | |
b70d9c24 IM |
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) | |
1da177e4 | 13 | { |
b70d9c24 IM |
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 | |
1da177e4 LT |
23 | |
24 | #endif |