diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-28 08:08:38 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-28 17:20:29 -0500 |
commit | ca6c8ed4646f8ccaa4f7db618bf69b8b8fb49767 (patch) | |
tree | 0d321219bba34dab2a43bad628042440cc493ed2 /arch/x86/include/asm/mach-default | |
parent | 9c7642470ecf03d8b4946a2addc8fe631b8426dd (diff) |
x86, apic: refactor ->get_apic_id() & GET_APIC_ID()
- spread out the namespace on a per driver basis
- get rid of macro wrappers
- small cleanups
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/mach-default')
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apic.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-default/mach_apicdef.h | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h index d0605281a6b7..8719208f2735 100644 --- a/arch/x86/include/asm/mach-default/mach_apic.h +++ b/arch/x86/include/asm/mach-default/mach_apic.h | |||
@@ -21,7 +21,7 @@ static inline const struct cpumask *default_target_cpus(void) | |||
21 | #include <asm/genapic.h> | 21 | #include <asm/genapic.h> |
22 | #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) | 22 | #define cpu_mask_to_apicid (apic->cpu_mask_to_apicid) |
23 | #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) | 23 | #define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and) |
24 | #define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID))) | 24 | #define read_apic_id() (apic->get_apic_id(apic_read(APIC_ID))) |
25 | #define send_IPI_self (apic->send_IPI_self) | 25 | #define send_IPI_self (apic->send_IPI_self) |
26 | #define wakeup_secondary_cpu (apic->wakeup_cpu) | 26 | #define wakeup_secondary_cpu (apic->wakeup_cpu) |
27 | extern void default_setup_apic_routing(void); | 27 | extern void default_setup_apic_routing(void); |
diff --git a/arch/x86/include/asm/mach-default/mach_apicdef.h b/arch/x86/include/asm/mach-default/mach_apicdef.h index b4dcc0971c76..e84d437ba2b2 100644 --- a/arch/x86/include/asm/mach-default/mach_apicdef.h +++ b/arch/x86/include/asm/mach-default/mach_apicdef.h | |||
@@ -5,20 +5,20 @@ | |||
5 | 5 | ||
6 | #ifdef CONFIG_X86_64 | 6 | #ifdef CONFIG_X86_64 |
7 | #define APIC_ID_MASK (apic->apic_id_mask) | 7 | #define APIC_ID_MASK (apic->apic_id_mask) |
8 | #define GET_APIC_ID(x) (apic->get_apic_id(x)) | ||
9 | #define SET_APIC_ID(x) (apic->set_apic_id(x)) | 8 | #define SET_APIC_ID(x) (apic->set_apic_id(x)) |
10 | #else | 9 | #else |
11 | #define APIC_ID_MASK (0xF<<24) | 10 | #define APIC_ID_MASK (0xF<<24) |
12 | static inline unsigned get_apic_id(unsigned long x) | 11 | |
12 | static inline unsigned default_get_apic_id(unsigned long x) | ||
13 | { | 13 | { |
14 | unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); | 14 | unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); |
15 | |||
15 | if (APIC_XAPIC(ver)) | 16 | if (APIC_XAPIC(ver)) |
16 | return (((x)>>24)&0xFF); | 17 | return (x >> 24) & 0xFF; |
17 | else | 18 | else |
18 | return (((x)>>24)&0xF); | 19 | return (x >> 24) & 0x0F; |
19 | } | 20 | } |
20 | 21 | ||
21 | #define GET_APIC_ID(x) get_apic_id(x) | ||
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #endif /* _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H */ | 24 | #endif /* _ASM_X86_MACH_DEFAULT_MACH_APICDEF_H */ |