summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 13:08:38 (GMT)
committerIngo Molnar <mingo@elte.hu>2009-01-28 22:20:29 (GMT)
commitca6c8ed4646f8ccaa4f7db618bf69b8b8fb49767 (patch)
tree0d321219bba34dab2a43bad628042440cc493ed2 /arch/x86/include/asm
parent9c7642470ecf03d8b4946a2addc8fe631b8426dd (diff)
downloadlinux-fsl-qoriq-ca6c8ed4646f8ccaa4f7db618bf69b8b8fb49767.tar.xz
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')
-rw-r--r--arch/x86/include/asm/bigsmp/apicdef.h6
-rw-r--r--arch/x86/include/asm/es7000/apicdef.h6
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h2
-rw-r--r--arch/x86/include/asm/mach-default/mach_apicdef.h10
-rw-r--r--arch/x86/include/asm/mach-generic/mach_apicdef.h1
-rw-r--r--arch/x86/include/asm/numaq/apicdef.h7
-rw-r--r--arch/x86/include/asm/smp.h2
-rw-r--r--arch/x86/include/asm/summit/apicdef.h6
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 392c3f5..ed25dd6 100644
--- a/arch/x86/include/asm/bigsmp/apicdef.h
+++ b/arch/x86/include/asm/bigsmp/apicdef.h
@@ -3,11 +3,9 @@
#define APIC_ID_MASK (0xFF<<24)
-static inline unsigned get_apic_id(unsigned long x)
+static inline unsigned bigsmp_get_apic_id(unsigned long x)
{
- return (((x)>>24)&0xFF);
+ return (x >> 24) & 0xFF;
}
-#define GET_APIC_ID(x) get_apic_id(x)
-
#endif
diff --git a/arch/x86/include/asm/es7000/apicdef.h b/arch/x86/include/asm/es7000/apicdef.h
index 8b234a3..e237917 100644
--- a/arch/x86/include/asm/es7000/apicdef.h
+++ b/arch/x86/include/asm/es7000/apicdef.h
@@ -3,11 +3,9 @@
#define APIC_ID_MASK (0xFF<<24)
-static inline unsigned get_apic_id(unsigned long x)
+static inline unsigned int es7000_get_apic_id(unsigned long x)
{
- return (((x)>>24)&0xFF);
+ return (x >> 24) & 0xFF;
}
-#define GET_APIC_ID(x) get_apic_id(x)
-
#endif
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index d060528..8719208 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)
#include <asm/genapic.h>
#define cpu_mask_to_apicid (apic->cpu_mask_to_apicid)
#define cpu_mask_to_apicid_and (apic->cpu_mask_to_apicid_and)
-#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID)))
+#define read_apic_id() (apic->get_apic_id(apic_read(APIC_ID)))
#define send_IPI_self (apic->send_IPI_self)
#define wakeup_secondary_cpu (apic->wakeup_cpu)
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 b4dcc09..e84d437 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 @@
#ifdef CONFIG_X86_64
#define APIC_ID_MASK (apic->apic_id_mask)
-#define GET_APIC_ID(x) (apic->get_apic_id(x))
#define SET_APIC_ID(x) (apic->set_apic_id(x))
#else
#define APIC_ID_MASK (0xF<<24)
-static inline unsigned get_apic_id(unsigned long x)
+
+static inline unsigned default_get_apic_id(unsigned long x)
{
unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
+
if (APIC_XAPIC(ver))
- return (((x)>>24)&0xFF);
+ return (x >> 24) & 0xFF;
else
- return (((x)>>24)&0xF);
+ return (x >> 24) & 0x0F;
}
-#define GET_APIC_ID(x) get_apic_id(x)
#endif
#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 acc9add..645520b 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 @@
#ifndef APIC_DEFINITION
#include <asm/genapic.h>
-#define GET_APIC_ID (apic->get_apic_id)
#define APIC_ID_MASK (apic->apic_id_mask)
#endif
diff --git a/arch/x86/include/asm/numaq/apicdef.h b/arch/x86/include/asm/numaq/apicdef.h
index e012a46..29f5e3d 100644
--- a/arch/x86/include/asm/numaq/apicdef.h
+++ b/arch/x86/include/asm/numaq/apicdef.h
@@ -1,14 +1,11 @@
#ifndef __ASM_NUMAQ_APICDEF_H
#define __ASM_NUMAQ_APICDEF_H
-
#define APIC_ID_MASK (0xF<<24)
-static inline unsigned get_apic_id(unsigned long x)
+static inline unsigned int numaq_get_apic_id(unsigned long x)
{
- return (((x)>>24)&0x0F);
+ return (x >> 24) & 0x0F;
}
-#define GET_APIC_ID(x) get_apic_id(x)
-
#endif
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index 45ef8a1..c63d480 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)
reg = *(u32 *)(APIC_BASE + APIC_ID);
- return GET_APIC_ID(reg);
+ return apic->get_apic_id(reg);
}
#endif
diff --git a/arch/x86/include/asm/summit/apicdef.h b/arch/x86/include/asm/summit/apicdef.h
index f3fbca1..4286528 100644
--- a/arch/x86/include/asm/summit/apicdef.h
+++ b/arch/x86/include/asm/summit/apicdef.h
@@ -3,11 +3,9 @@
#define APIC_ID_MASK (0xFF<<24)
-static inline unsigned get_apic_id(unsigned long x)
+static inline unsigned summit_get_apic_id(unsigned long x)
{
- return (x>>24)&0xFF;
+ return (x >> 24) & 0xFF;
}
-#define GET_APIC_ID(x) get_apic_id(x)
-
#endif