浏览代码

x86: move elfcorehdr parsing to setup.c

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Yinghai Lu 17 年之前
父节点
当前提交
17b4cceb1f
共有 2 个文件被更改,包括 19 次插入16 次删除
  1. 19 0
      arch/x86/kernel/setup.c
  2. 0 16
      arch/x86/kernel/setup_32.c

+ 19 - 0
arch/x86/kernel/setup.c

@@ -4,6 +4,7 @@
 #include <linux/bootmem.h>
 #include <linux/bootmem.h>
 #include <linux/percpu.h>
 #include <linux/percpu.h>
 #include <linux/kexec.h>
 #include <linux/kexec.h>
+#include <linux/crash_dump.h>
 #include <asm/smp.h>
 #include <asm/smp.h>
 #include <asm/percpu.h>
 #include <asm/percpu.h>
 #include <asm/sections.h>
 #include <asm/sections.h>
@@ -501,3 +502,21 @@ void __init reserve_standard_io_resources(void)
 
 
 }
 }
 
 
+#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
+
+
+

+ 0 - 16
arch/x86/kernel/setup_32.c

@@ -42,7 +42,6 @@
 #include <linux/iscsi_ibft.h>
 #include <linux/iscsi_ibft.h>
 #include <linux/nodemask.h>
 #include <linux/nodemask.h>
 #include <linux/kexec.h>
 #include <linux/kexec.h>
-#include <linux/crash_dump.h>
 #include <linux/dmi.h>
 #include <linux/dmi.h>
 #include <linux/pfn.h>
 #include <linux/pfn.h>
 #include <linux/pci.h>
 #include <linux/pci.h>
@@ -194,21 +193,6 @@ static inline void copy_edd(void)
 }
 }
 #endif
 #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.
  * highmem=size forces highmem to be exactly 'size' bytes.
  * This works even on boxes that have no highmem otherwise.
  * This works even on boxes that have no highmem otherwise.