[PATCH 10/20] x86: kill smpboot_hooks.h

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai Lu
Date: Sunday, March 21, 2010 - 12:13 am

only one user, move it back to smpboot.c

remove smpboot_clear_io_apic, and only keep smpboot_clear_io_apic_irqs.

and check nr_legacy_irqs before clear it.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/include/asm/smpboot_hooks.h |   61 ----------------------------------
 arch/x86/kernel/smpboot.c            |   57 ++++++++++++++++++++++++++++++--
 2 files changed, 54 insertions(+), 64 deletions(-)
 delete mode 100644 arch/x86/include/asm/smpboot_hooks.h

diff --git a/arch/x86/include/asm/smpboot_hooks.h b/arch/x86/include/asm/smpboot_hooks.h
deleted file mode 100644
index 1def601..0000000
--- a/arch/x86/include/asm/smpboot_hooks.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* two abstractions specific to kernel/smpboot.c, mainly to cater to visws
- * which needs to alter them. */
-
-static inline void smpboot_clear_io_apic_irqs(void)
-{
-#ifdef CONFIG_X86_IO_APIC
-	io_apic_irqs = 0;
-#endif
-}
-
-static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip)
-{
-	CMOS_WRITE(0xa, 0xf);
-	local_flush_tlb();
-	pr_debug("1.\n");
-	*((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_high)) =
-								 start_eip >> 4;
-	pr_debug("2.\n");
-	*((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_low)) =
-							 start_eip & 0xf;
-	pr_debug("3.\n");
-}
-
-static inline void smpboot_restore_warm_reset_vector(void)
-{
-	/*
-	 * Install writable page 0 entry to set BIOS data area.
-	 */
-	local_flush_tlb();
-
-	/*
-	 * Paranoid:  Set warm reset code and vector here back
-	 * to default values.
-	 */
-	CMOS_WRITE(0, 0xf);
-
-	*((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0;
-}
-
-static inline void __init smpboot_setup_io_apic(void)
-{
-#ifdef CONFIG_X86_IO_APIC
-	/*
-	 * Here we can be sure that there is an IO-APIC in the system. Let's
-	 * go and set it up:
-	 */
-	if (!skip_ioapic_setup && nr_ioapics)
-		setup_IO_APIC();
-	else {
-		nr_ioapics = 0;
-		localise_nmi_watchdog();
-	}
-#endif
-}
-
-static inline void smpboot_clear_io_apic(void)
-{
-#ifdef CONFIG_X86_IO_APIC
-	nr_ioapics = 0;
-#endif
-}
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 06d98ae..ba43b3b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -67,7 +67,6 @@
 #include <asm/uv/uv.h>
 #include <linux/mc146818rtc.h>
 
-#include <asm/smpboot_hooks.h>
 #include <asm/i8259.h>
 
 #ifdef CONFIG_X86_32
@@ -701,6 +700,35 @@ static void __cpuinit announce_cpu(int cpu, int apicid)
 			node, cpu, apicid);
 }
 
+static void smpboot_setup_warm_reset_vector(unsigned long start_eip)
+{
+	CMOS_WRITE(0xa, 0xf);
+	local_flush_tlb();
+	pr_debug("1.\n");
+	*((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_high)) =
+								 start_eip >> 4;
+	pr_debug("2.\n");
+	*((volatile unsigned short *)phys_to_virt(apic->trampoline_phys_low)) =
+							 start_eip & 0xf;
+	pr_debug("3.\n");
+}
+
+static void smpboot_restore_warm_reset_vector(void)
+{
+	/*
+	 * Install writable page 0 entry to set BIOS data area.
+	 */
+	local_flush_tlb();
+
+	/*
+	 * Paranoid:  Set warm reset code and vector here back
+	 * to default values.
+	 */
+	CMOS_WRITE(0, 0xf);
+
+	*((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0;
+}
+
 /*
  * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
  * (ie clustered apic addressing mode), this is a LOGICAL apic ID.
@@ -928,6 +956,13 @@ int __cpuinit native_cpu_up(unsigned int cpu)
 	return 0;
 }
 
+static void smpboot_clear_io_apic_irqs(void)
+{
+#ifdef CONFIG_X86_IO_APIC
+	if (legacy_pic->nr_legacy_irqs)
+		io_apic_irqs = 0;
+#endif
+}
 /*
  * Fall back to non SMP mode after errors.
  *
@@ -1027,7 +1062,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
 			pr_err("... forcing use of dummy APIC emulation."
 				"(tell your hw vendor)\n");
 		}
-		smpboot_clear_io_apic();
+		smpboot_clear_io_apic_irqs();
 		arch_disable_smp_support();
 		return -1;
 	}
@@ -1039,7 +1074,7 @@ static int __init smp_sanity_check(unsigned max_cpus)
 	 */
 	if (!max_cpus) {
 		printk(KERN_INFO "SMP mode deactivated.\n");
-		smpboot_clear_io_apic();
+		smpboot_clear_io_apic_irqs();
 
 		localise_nmi_watchdog();
 
@@ -1064,6 +1099,22 @@ static void __init smp_cpu_index_default(void)
 	}
 }
 
+static void __init smpboot_setup_io_apic(void)
+{
+#ifdef CONFIG_X86_IO_APIC
+	/*
+	 * Here we can be sure that there is an IO-APIC in the system. Let's
+	 * go and set it up:
+	 */
+	if (!skip_ioapic_setup && nr_ioapics)
+		setup_IO_APIC();
+	else {
+		nr_ioapics = 0;
+		localise_nmi_watchdog();
+	}
+#endif
+}
+
 /*
  * Prepare for SMP bootup.  The MP table or ACPI has been read
  * earlier.  Just do some sanity checking here and enable APIC mode.
-- 
1.6.4.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/20] x86: early_res and irq_desc, Yinghai Lu, (Sun Mar 21, 12:13 am)
[PATCH 01/20] x86: add find_e820_area_node, Yinghai Lu, (Sun Mar 21, 12:13 am)
[PATCH 02/20] x86: add get_centaur_ram_top, Yinghai Lu, (Sun Mar 21, 12:13 am)
[PATCH 03/20] x86: make e820 to be static, Yinghai Lu, (Sun Mar 21, 12:13 am)
[PATCH 05/20] x86: make e820 to be initdata, Yinghai Lu, (Sun Mar 21, 12:13 am)
[PATCH 08/20] x86: fix out of order of gsi - full, Yinghai Lu, (Sun Mar 21, 12:13 am)
[PATCH 10/20] x86: kill smpboot_hooks.h, Yinghai Lu, (Sun Mar 21, 12:13 am)
[PATCH 18/20] x86: remove arch_probe_nr_irqs, Yinghai Lu, (Sun Mar 21, 12:13 am)
Re: [PATCH 00/20] x86: early_res and irq_desc, Benjamin Herrenschmidt, (Sun Mar 21, 7:35 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Sun Mar 21, 7:37 pm)
Questions about SMP bootup control, Zhu, Yijun (NSN - CN ..., (Sun Mar 21, 7:46 pm)
Re: [PATCH 00/20] x86: early_res and irq_desc, Yinghai Lu, (Sun Mar 21, 8:26 pm)
Re: Questions about SMP bootup control, Andi Kleen, (Sun Mar 21, 8:29 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Sun Mar 21, 10:12 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Eric W. Biederman, (Mon Mar 22, 12:05 am)
RE: Questions about SMP bootup control, Zhu, Yijun (NSN - CN ..., (Mon Mar 22, 12:45 am)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Mon Mar 22, 1:47 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Mon Mar 22, 2:01 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Mon Mar 22, 2:04 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Mon Mar 22, 2:07 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Mon Mar 22, 2:08 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Mon Mar 22, 2:52 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Mon Mar 22, 2:54 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Geert Uytterhoeven, (Tue Mar 23, 1:53 am)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Tue Mar 23, 9:24 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Tue Mar 23, 9:29 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Tue Mar 23, 9:44 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Tue Mar 23, 9:50 pm)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Wed Mar 24, 12:43 am)
Re: [PATCH 06/20] early_res: seperate common memmap func f ..., Benjamin Herrenschmidt, (Wed Mar 24, 2:32 am)