]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
x86: merge hard/logical_smp_processor_id
authorGlauber Costa <gcosta@redhat.com>
Thu, 27 Mar 2008 17:05:58 +0000 (14:05 -0300)
committerIngo Molnar <mingo@elte.hu>
Thu, 17 Apr 2008 15:41:32 +0000 (17:41 +0200)
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>
include/asm-x86/smp.h
include/asm-x86/smp_32.h
include/asm-x86/smp_64.h

index ef26911dc22a039513a1fa1664af24f209675d98..e5534f19c312f161c2dff916d4c83848fd002c92 100644 (file)
@@ -123,6 +123,33 @@ void smp_store_cpu_info(int id);
 # include "smp_64.h"
 #endif
 
+#ifdef CONFIG_X86_LOCAL_APIC
+
+static inline int logical_smp_processor_id(void)
+{
+       /* we don't want to mark this access volatile - bad code generation */
+       return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
+}
+
+# ifdef APIC_DEFINITION
+extern int hard_smp_processor_id(void);
+# else
+#  include <mach_apicdef.h>
+static inline int hard_smp_processor_id(void)
+{
+       /* we don't want to mark this access volatile - bad code generation */
+       return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
+}
+# endif /* APIC_DEFINITION */
+
+#else /* CONFIG_X86_LOCAL_APIC */
+
+# ifndef CONFIG_SMP
+#  define hard_smp_processor_id()      0
+# endif
+
+#endif /* CONFIG_X86_LOCAL_APIC */
+
 #ifdef CONFIG_HOTPLUG_CPU
 extern void cpu_exit_clear(void);
 extern void cpu_uninit(void);
index cb3ada2fedbfd5103744162f0b6bbf9a0da45fe4..53432dbd54268dd8599864ce897b2f51040553e4 100644 (file)
@@ -42,32 +42,5 @@ static inline int num_booting_cpus(void)
 #define safe_smp_processor_id()                0
 #endif /* !CONFIG_SMP */
 
-#ifdef CONFIG_X86_LOCAL_APIC
-
-static inline int logical_smp_processor_id(void)
-{
-       /* we don't want to mark this access volatile - bad code generation */
-       return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
-}
-
-# ifdef APIC_DEFINITION
-extern int hard_smp_processor_id(void);
-# else
-#  include <mach_apicdef.h>
-static inline int hard_smp_processor_id(void)
-{
-       /* we don't want to mark this access volatile - bad code generation */
-       return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
-}
-# endif /* APIC_DEFINITION */
-
-#else /* CONFIG_X86_LOCAL_APIC */
-
-# ifndef CONFIG_SMP
-#  define hard_smp_processor_id()      0
-# endif
-
-#endif /* CONFIG_X86_LOCAL_APIC */
-
 #endif /* !ASSEMBLY */
 #endif
index c46585e09ea1cd596e4c10f4a4cc3ba535acff23..015d36e29adede221001fa9f5dafa0443b0b9b7e 100644 (file)
@@ -46,32 +46,5 @@ static inline int num_booting_cpus(void)
 
 #define safe_smp_processor_id()                smp_processor_id()
 
-#ifdef CONFIG_X86_LOCAL_APIC
-
-static inline int logical_smp_processor_id(void)
-{
-       /* we don't want to mark this access volatile - bad code generation */
-       return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
-}
-
-# ifdef APIC_DEFINITION
-extern int hard_smp_processor_id(void);
-# else
-#  include <mach_apicdef.h>
-static inline int hard_smp_processor_id(void)
-{
-       /* we don't want to mark this access volatile - bad code generation */
-       return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
-}
-# endif /* APIC_DEFINITION */
-
-#else /* CONFIG_X86_LOCAL_APIC */
-
-# ifndef CONFIG_SMP
-#  define hard_smp_processor_id()      0
-# endif
-
-#endif /* CONFIG_X86_LOCAL_APIC */
-
 #endif