x86: generalize boot_cpu_id

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Saturday, March 28, 2009 - 2:13 pm

Gitweb:     http://git.kernel.org/linus/c0b5842a457d44c8788b3fd0c64969be7ef673cd
Commit:     c0b5842a457d44c8788b3fd0c64969be7ef673cd
Parent:     3e5095d15276efd14a45393666b1bb7536bf179f
Author:     Ingo Molnar <mingo@elte.hu>
AuthorDate: Tue Jan 27 17:13:05 2009 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu Jan 29 14:17:01 2009 +0100

    x86: generalize boot_cpu_id
    
    x86/Voyager can boot on non-zero processors. While that can probably
    be fixed by properly remapping the physical CPU IDs, keep boot_cpu_id
    for now for easier transition - and expand it to all of x86.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/Kconfig           |    4 ----
 arch/x86/include/asm/cpu.h |    6 +-----
 arch/x86/kernel/setup.c    |   14 ++++++++++++++
 arch/x86/kernel/smpboot.c  |   12 ------------
 4 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 3671506..f4dd851 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -238,10 +238,6 @@ config SMP
 
 	  If you don't know what to do here, say N.
 
-config X86_HAS_BOOT_CPU_ID
-	def_bool y
-	depends on X86_VOYAGER
-
 config SPARSE_IRQ
 	bool "Support sparse irq numbering"
 	depends on PCI_MSI || HT_IRQ
diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index f03b23e..b185091 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -32,10 +32,6 @@ extern void arch_unregister_cpu(int);
 
 DECLARE_PER_CPU(int, cpu_state);
 
-#ifdef CONFIG_X86_HAS_BOOT_CPU_ID
-extern unsigned char boot_cpu_id;
-#else
-#define boot_cpu_id				0
-#endif
+extern unsigned int boot_cpu_id;
 
 #endif /* _ASM_X86_CPU_H */
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index eeb180b..609e5af 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -112,6 +112,20 @@
 #define ARCH_SETUP
 #endif
 
+unsigned int boot_cpu_id __read_mostly;
+
+#ifdef CONFIG_X86_64
+int default_cpu_present_to_apicid(int mps_cpu)
+{
+	return __default_cpu_present_to_apicid(mps_cpu);
+}
+
+int default_check_phys_apicid_present(int boot_cpu_physical_apicid)
+{
+	return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
+}
+#endif
+
 #ifndef CONFIG_DEBUG_BOOT_PARAMS
 struct boot_params __initdata boot_params;
 #else
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index e90b3e5..bc7e220 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -905,18 +905,6 @@ do_rest:
 	return boot_error;
 }
 
-#ifdef CONFIG_X86_64
-int default_cpu_present_to_apicid(int mps_cpu)
-{
-	return __default_cpu_present_to_apicid(mps_cpu);
-}
-
-int default_check_phys_apicid_present(int boot_cpu_physical_apicid)
-{
-	return __default_check_phys_apicid_present(boot_cpu_physical_apicid);
-}
-#endif
-
 int __cpuinit native_cpu_up(unsigned int cpu)
 {
 	int apicid = apic->cpu_present_to_apicid(cpu);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86: generalize boot_cpu_id, Linux Kernel Mailing ..., (Sat Mar 28, 2:13 pm)