summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/mach-default
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 14:08:38 +0100
committerIngo Molnar <mingo@elte.hu>2009-01-28 23:20:29 +0100
commitca6c8ed4646f8ccaa4f7db618bf69b8b8fb49767 (patch)
tree0d321219bba34dab2a43bad628042440cc493ed2 /arch/x86/include/asm/mach-default
parent9c7642470ecf03d8b4946a2addc8fe631b8426dd (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.h2
-rw-r--r--arch/x86/include/asm/mach-default/mach_apicdef.h10
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)
#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 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 @@
#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 */