aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/smp.h
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-07-11 21:44:16 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-12 02:45:14 -0400
commit4c9961d56ec20c27ec5d02e49fd7427748312741 (patch)
treee3a0fd508aae031dcd06705a2ce77f7dd0a68c11 /include/asm-x86/smp.h
parent4696ca5bfd2697f5686f96d59cf0b6de14869b4e (diff)
x86: make read_apic_id return final apicid
also remove GET_APIC_ID when read_apic_id is used. need to apply after [PATCH] x86: mach_apicdef.h need to include before smp.h Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/smp.h')
-rw-r--r--include/asm-x86/smp.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h
index d9d007d22785..3b43ca202c3b 100644
--- a/include/asm-x86/smp.h
+++ b/include/asm-x86/smp.h
@@ -165,9 +165,14 @@ static inline int logical_smp_processor_id(void)
165 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); 165 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
166} 166}
167 167
168#include <mach_apicdef.h>
168static inline unsigned int read_apic_id(void) 169static inline unsigned int read_apic_id(void)
169{ 170{
170 return *(u32 *)(APIC_BASE + APIC_ID); 171 unsigned int reg;
172
173 reg = *(u32 *)(APIC_BASE + APIC_ID);
174
175 return GET_APIC_ID(reg);
171} 176}
172#endif 177#endif
173 178
@@ -175,11 +180,11 @@ static inline unsigned int read_apic_id(void)
175# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64) 180# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
176extern int hard_smp_processor_id(void); 181extern int hard_smp_processor_id(void);
177# else 182# else
178# include <mach_apicdef.h> 183#include <mach_apicdef.h>
179static inline int hard_smp_processor_id(void) 184static inline int hard_smp_processor_id(void)
180{ 185{
181 /* we don't want to mark this access volatile - bad code generation */ 186 /* we don't want to mark this access volatile - bad code generation */
182 return GET_APIC_ID(read_apic_id()); 187 return read_apic_id();
183} 188}
184# endif /* APIC_DEFINITION */ 189# endif /* APIC_DEFINITION */
185 190