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 | |
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')
-rw-r--r-- | arch/x86/include/asm/bigsmp/apicdef.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/es7000/apicdef.h | 6 | ||||
-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 | ||||
-rw-r--r-- | arch/x86/include/asm/mach-generic/mach_apicdef.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/numaq/apicdef.h | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/smp.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/summit/apicdef.h | 6 |
8 files changed, 15 insertions, 25 deletions
diff --git a/arch/x86/include/asm/bigsmp/apicdef.h b/arch/x86/include/asm/bigsmp/apicdef.h index 392c3f5ef2fe..ed25dd6503b2 100644 --- a/arch/x86/include/asm/bigsmp/apicdef.h +++ b/arch/x86/include/asm/bigsmp/apicdef.h | |||
@@ -3,11 +3,9 @@ | |||
3 | 3 | ||
4 | #define APIC_ID_MASK (0xFF<<24) | 4 | #define APIC_ID_MASK (0xFF<<24) |
5 | 5 | ||
6 | static inline unsigned get_apic_id(unsigned long x) | 6 | static inline unsigned bigsmp_get_apic_id(unsigned long x) |
7 | { | 7 | { |
8 | return (((x)>>24)&0xFF); | 8 | return (x >> 24) & 0xFF; |
9 | } | 9 | } |
10 | 10 | ||
11 | #define GET_APIC_ID(x) get_apic_id(x) | ||
12 | |||
13 | #endif | 11 | #endif |
diff --git a/arch/x86/include/asm/es7000/apicdef.h b/arch/x86/include/asm/es7000/apicdef.h index 8b234a3cb851..e23791762a19 100644 --- a/arch/x86/include/asm/es7000/apicdef.h +++ b/arch/x86/include/asm/es7000/apicdef.h | |||
@@ -3,11 +3,9 @@ | |||
3 | 3 | ||
4 | #define APIC_ID_MASK (0xFF<<24) | 4 | #define APIC_ID_MASK (0xFF<<24) |
5 | 5 | ||
6 | static inline unsigned get_apic_id(unsigned long x) | 6 | static inline unsigned int es7000_get_apic_id(unsigned long x) |
7 | { | 7 | { |
8 | return (((x)>>24)&0xFF); | 8 | return (x >> 24) & 0xFF; |
9 | } | 9 | } |
10 | 10 | ||
11 | #define GET_APIC_ID(x) get_apic_id(x) | ||
12 | |||
13 | #endif | 11 | #endif |
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 */ |
diff --git a/arch/x86/include/asm/mach-generic/mach_apicdef.h b/arch/x86/include/asm/mach-generic/mach_apicdef.h index acc9adddb344..645520bcd2c2 100644 --- a/arch/x86/include/asm/mach-generic/mach_apicdef.h +++ b/arch/x86/include/asm/mach-generic/mach_apicdef.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #ifndef APIC_DEFINITION | 4 | #ifndef APIC_DEFINITION |
5 | #include <asm/genapic.h> | 5 | #include <asm/genapic.h> |
6 | 6 | ||
7 | #define GET_APIC_ID (apic->get_apic_id) | ||
8 | #define APIC_ID_MASK (apic->apic_id_mask) | 7 | #define APIC_ID_MASK (apic->apic_id_mask) |
9 | #endif | 8 | #endif |
10 | 9 | ||
diff --git a/arch/x86/include/asm/numaq/apicdef.h b/arch/x86/include/asm/numaq/apicdef.h index e012a46cc22a..29f5e3d34e5b 100644 --- a/arch/x86/include/asm/numaq/apicdef.h +++ b/arch/x86/include/asm/numaq/apicdef.h | |||
@@ -1,14 +1,11 @@ | |||
1 | #ifndef __ASM_NUMAQ_APICDEF_H | 1 | #ifndef __ASM_NUMAQ_APICDEF_H |
2 | #define __ASM_NUMAQ_APICDEF_H | 2 | #define __ASM_NUMAQ_APICDEF_H |
3 | 3 | ||
4 | |||
5 | #define APIC_ID_MASK (0xF<<24) | 4 | #define APIC_ID_MASK (0xF<<24) |
6 | 5 | ||
7 | static inline unsigned get_apic_id(unsigned long x) | 6 | static inline unsigned int numaq_get_apic_id(unsigned long x) |
8 | { | 7 | { |
9 | return (((x)>>24)&0x0F); | 8 | return (x >> 24) & 0x0F; |
10 | } | 9 | } |
11 | 10 | ||
12 | #define GET_APIC_ID(x) get_apic_id(x) | ||
13 | |||
14 | #endif | 11 | #endif |
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 45ef8a1b9d7c..c63d480802af 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -189,7 +189,7 @@ static inline unsigned int read_apic_id(void) | |||
189 | 189 | ||
190 | reg = *(u32 *)(APIC_BASE + APIC_ID); | 190 | reg = *(u32 *)(APIC_BASE + APIC_ID); |
191 | 191 | ||
192 | return GET_APIC_ID(reg); | 192 | return apic->get_apic_id(reg); |
193 | } | 193 | } |
194 | #endif | 194 | #endif |
195 | 195 | ||
diff --git a/arch/x86/include/asm/summit/apicdef.h b/arch/x86/include/asm/summit/apicdef.h index f3fbca1f61c1..4286528af7c6 100644 --- a/arch/x86/include/asm/summit/apicdef.h +++ b/arch/x86/include/asm/summit/apicdef.h | |||
@@ -3,11 +3,9 @@ | |||
3 | 3 | ||
4 | #define APIC_ID_MASK (0xFF<<24) | 4 | #define APIC_ID_MASK (0xFF<<24) |
5 | 5 | ||
6 | static inline unsigned get_apic_id(unsigned long x) | 6 | static inline unsigned summit_get_apic_id(unsigned long x) |
7 | { | 7 | { |
8 | return (x>>24)&0xFF; | 8 | return (x >> 24) & 0xFF; |
9 | } | 9 | } |
10 | 10 | ||
11 | #define GET_APIC_ID(x) get_apic_id(x) | ||
12 | |||
13 | #endif | 11 | #endif |