[PATCH] Retrieve elfcorehdr address from command line
authorVivek Goyal <vgoyal@in.ibm.com>
Sat, 25 Jun 2005 21:58:20 +0000 (14:58 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 25 Jun 2005 23:24:53 +0000 (16:24 -0700)
This patch adds support for retrieving the address of elf core header if one
is passed in command line.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Documentation/kernel-parameters.txt
arch/i386/kernel/setup.c
include/linux/crash_dump.h
kernel/crash_dump.c

index 560ff5ae3fd990369b182527cd3d3499e3036cc0..f44bb5567c5bc1816ed8dc30442fdb09a17ce3f2 100644 (file)
@@ -451,6 +451,10 @@ running once the system is up.
                        Format: {"as"|"cfq"|"deadline"|"noop"}
                        See Documentation/block/as-iosched.txt
                        and Documentation/block/deadline-iosched.txt for details.
+       elfcorehdr=     [IA-32]
+                       Specifies physical address of start of kernel core image
+                       elf header.
+                       See Documentation/kdump.txt for details.
 
        enforcing       [SELINUX] Set initial enforcing status.
                        Format: {"0" | "1"}
index 8d58a053e12e097fb067a85fb2cab44c06a4517a..7306353c520ec6dc4c74a6cac328f8b5ba446d64 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/edd.h>
 #include <linux/nodemask.h>
 #include <linux/kexec.h>
+#include <linux/crash_dump.h>
 
 #include <video/edid.h>
 
@@ -881,6 +882,13 @@ static void __init parse_cmdline_early (char ** cmdline_p)
                        }
                }
 #endif
+#ifdef CONFIG_CRASH_DUMP
+               /* elfcorehdr= specifies the location of elf core header
+                * stored by the crashed kernel.
+                */
+               else if (!memcmp(from, "elfcorehdr=", 11))
+                       elfcorehdr_addr = memparse(from+11, &from);
+#endif
 
                /*
                 * highmem=size forces highmem to be exactly 'size' bytes.
index 7d983b817429510811d3df24c9102a5b43d9f32d..3f25fd1eaa4b27ac7a6195242ae400814eeb5a3c 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/device.h>
 #include <linux/proc_fs.h>
 
+extern unsigned long long elfcorehdr_addr;
 extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
                                                unsigned long, int);
 #endif /* CONFIG_CRASH_DUMP */
index 5a1e6d5d203e708ce70ae110e38faf5abbcca983..10b966c3744c7166757a51293a80859bdeff514c 100644 (file)
@@ -15,6 +15,9 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
+/* Stores the physical address of elf header of crash image. */
+unsigned long long elfcorehdr_addr;
+
 /*
  * Copy a page from "oldmem". For this page, there is no pte mapped
  * in the current kernel. We stitch up a pte, similar to kmap_atomic.