aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/smp.h
diff options
context:
space:
mode:
authorGlauber Costa <gcosta@redhat.com>2008-03-27 13:05:58 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:32 -0400
commit1b00084386878f25c2c591ad19cb625880d4089d (patch)
tree86dd602eb31a10d64a1b7e07fa6ea2f272d6c25b /include/asm-x86/smp.h
parent2ba95bcbe68d692f549fb10809f15681a25ff6fb (diff)
x86: merge hard/logical_smp_processor_id
The code is now the same between i386 and x86_64. We already know what happens when it reaches this point: They go away from the arch-specific headers, and suddenly appears in the common header. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/smp.h')
-rw-r--r--include/asm-x86/smp.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h
index ef26911dc22a..e5534f19c312 100644
--- a/include/asm-x86/smp.h
+++ b/include/asm-x86/smp.h
@@ -123,6 +123,33 @@ void smp_store_cpu_info(int id);
123# include "smp_64.h" 123# include "smp_64.h"
124#endif 124#endif
125 125
126#ifdef CONFIG_X86_LOCAL_APIC
127
128static inline int logical_smp_processor_id(void)
129{
130 /* we don't want to mark this access volatile - bad code generation */
131 return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
132}
133
134# ifdef APIC_DEFINITION
135extern int hard_smp_processor_id(void);
136# else
137# include <mach_apicdef.h>
138static inline int hard_smp_processor_id(void)
139{
140 /* we don't want to mark this access volatile - bad code generation */
141 return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
142}
143# endif /* APIC_DEFINITION */
144
145#else /* CONFIG_X86_LOCAL_APIC */
146
147# ifndef CONFIG_SMP
148# define hard_smp_processor_id() 0
149# endif
150
151#endif /* CONFIG_X86_LOCAL_APIC */
152
126#ifdef CONFIG_HOTPLUG_CPU 153#ifdef CONFIG_HOTPLUG_CPU
127extern void cpu_exit_clear(void); 154extern void cpu_exit_clear(void);
128extern void cpu_uninit(void); 155extern void cpu_uninit(void);