[PATCH] x86: move elfcorehdr parsing to setup.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai Lu
Date: Saturday, June 21, 2008 - 9:02 pm

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

---
 arch/x86/kernel/setup.c    |   19 +++++++++++++++++++
 arch/x86/kernel/setup_32.c |   16 ----------------
 arch/x86/kernel/setup_64.c |   17 -----------------
 3 files changed, 19 insertions(+), 33 deletions(-)

Index: linux-2.6/arch/x86/kernel/setup_64.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_64.c
+++ linux-2.6/arch/x86/kernel/setup_64.c
@@ -26,7 +26,6 @@
 #include <asm/processor.h>
 #include <linux/console.h>
 #include <linux/seq_file.h>
-#include <linux/crash_dump.h>
 #include <linux/root_dev.h>
 #include <linux/pci.h>
 #include <asm/pci-direct.h>
@@ -131,22 +130,6 @@ static struct resource bss_resource = {
 	.flags = IORESOURCE_RAM,
 };
 
-#ifdef CONFIG_PROC_VMCORE
-/* elfcorehdr= specifies the location of elf core header
- * stored by the crashed kernel. This option will be passed
- * by kexec loader to the capture kernel.
- */
-static int __init setup_elfcorehdr(char *arg)
-{
-	char *end;
-	if (!arg)
-		return -EINVAL;
-	elfcorehdr_addr = memparse(arg, &end);
-	return end > arg ? 0 : -EINVAL;
-}
-early_param("elfcorehdr", setup_elfcorehdr);
-#endif
-
 #ifndef CONFIG_NUMA
 static void __init
 contig_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
Index: linux-2.6/arch/x86/kernel/setup_32.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_32.c
+++ linux-2.6/arch/x86/kernel/setup_32.c
@@ -42,7 +42,6 @@
 #include <linux/iscsi_ibft.h>
 #include <linux/nodemask.h>
 #include <linux/kexec.h>
-#include <linux/crash_dump.h>
 #include <linux/dmi.h>
 #include <linux/pfn.h>
 #include <linux/pci.h>
@@ -195,21 +194,6 @@ static inline void copy_edd(void)
 }
 #endif
 
-#ifdef CONFIG_PROC_VMCORE
-/* elfcorehdr= specifies the location of elf core header
- * stored by the crashed kernel.
- */
-static int __init parse_elfcorehdr(char *arg)
-{
-	if (!arg)
-		return -EINVAL;
-
-	elfcorehdr_addr = memparse(arg, &arg);
-	return 0;
-}
-early_param("elfcorehdr", parse_elfcorehdr);
-#endif /* CONFIG_PROC_VMCORE */
-
 /*
  * highmem=size forces highmem to be exactly 'size' bytes.
  * This works even on boxes that have no highmem otherwise.
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -4,6 +4,7 @@
 #include <linux/bootmem.h>
 #include <linux/percpu.h>
 #include <linux/kexec.h>
+#include <linux/crash_dump.h>
 #include <asm/smp.h>
 #include <asm/percpu.h>
 #include <asm/sections.h>
@@ -500,3 +501,21 @@ void __init reserve_standard_io_resource
 		request_resource(&ioport_resource, &standard_io_resources[i]);
 
 }
+
+#ifdef CONFIG_PROC_VMCORE
+/* elfcorehdr= specifies the location of elf core header
+ * stored by the crashed kernel. This option will be passed
+ * by kexec loader to the capture kernel.
+ */
+static int __init setup_elfcorehdr(char *arg)
+{
+	char *end;
+	if (!arg)
+		return -EINVAL;
+	elfcorehdr_addr = memparse(arg, &end);
+	return end > arg ? 0 : -EINVAL;
+}
+early_param("elfcorehdr", setup_elfcorehdr);
+#endif
+
+
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: make 64bit identify_cpu use cpu_dev, Yinghai Lu, (Wed Jun 18, 2:15 am)
Re: [PATCH] x86: make 64bit identify_cpu use cpu_dev, Ingo Molnar, (Wed Jun 18, 7:17 am)
Re: [PATCH] x86: make 64bit identify_cpu use cpu_dev, Ingo Molnar, (Thu Jun 19, 2:03 am)
Re: [PATCH] x86: make 64bit identify_cpu use cpu_dev, Yinghai Lu, (Thu Jun 19, 1:00 pm)
[PATCH] x86: make 64bit identify_cpu use cpu_dev v2, Yinghai Lu, (Thu Jun 19, 3:30 pm)
Re: [PATCH] x86: make 64bit identify_cpu use cpu_dev v2, Ingo Molnar, (Thu Jun 19, 11:29 pm)
[PATCH] x86: merge setup64.c into common_64.c, Yinghai Lu, (Sat Jun 21, 4:25 pm)
[PATCH] x86: move elfcorehdr parsing to setup.c, Yinghai Lu, (Sat Jun 21, 9:02 pm)
[PATCH] x86: introduce initmem_init for 64 bit, Yinghai Lu, (Sun Jun 22, 2:44 am)
[PATCH] x86: introduce initmem_init for 32 bit, Yinghai Lu, (Sun Jun 22, 2:45 am)
[PATCH] x86: introduce reserve_initrd, Yinghai Lu, (Sun Jun 22, 2:46 am)
[PATCH] x86: move boot_params declaring to setup.c, Yinghai Lu, (Sun Jun 22, 5:37 pm)
[PATCH] x86: introduce reserve_initrd, Yinghai Lu, (Sun Jun 22, 5:40 pm)
[PATCH] x86: cleanup using max_low_pfn for 32 bit, Yinghai Lu, (Mon Jun 23, 3:05 am)
[PATCH] x86: cleanup min_low_pfn, Yinghai Lu, (Mon Jun 23, 3:06 am)
Re: [PATCH] x86: cleanup using max_low_pfn for 32 bit, Ingo Molnar, (Mon Jun 23, 12:56 pm)
Re: [PATCH] x86: cleanup using max_low_pfn for 32 bit, H. Peter Anvin, (Mon Jun 23, 12:57 pm)
Re: [PATCH] x86: cleanup using max_low_pfn for 32 bit, Ingo Molnar, (Mon Jun 23, 1:22 pm)