summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@in.ibm.com>2005-06-25 14:58:20 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 16:24:53 -0700
commit2030eae52b416a9a9f0ffda74c982b7f1e19496d (patch)
tree3715724cb19e9165873635fcdf7e9e30d86f7710
parent60e64d46a58236e3c718074372cab6a5b56a3b15 (diff)
[PATCH] Retrieve elfcorehdr address from command line
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>
-rw-r--r--Documentation/kernel-parameters.txt4
-rw-r--r--arch/i386/kernel/setup.c8
-rw-r--r--include/linux/crash_dump.h1
-rw-r--r--kernel/crash_dump.c3
4 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 560ff5ae3fd9..f44bb5567c5b 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -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"}
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 8d58a053e12e..7306353c520e 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -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.
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 7d983b817429..3f25fd1eaa4b 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -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 */
diff --git a/kernel/crash_dump.c b/kernel/crash_dump.c
index 5a1e6d5d203e..10b966c3744c 100644
--- a/kernel/crash_dump.c
+++ b/kernel/crash_dump.c
@@ -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.