aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/crash_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/crash_dump.c')
-rw-r--r--kernel/crash_dump.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/crash_dump.c b/kernel/crash_dump.c
index 5f85690285d4..c766ee54c0b1 100644
--- a/kernel/crash_dump.c
+++ b/kernel/crash_dump.c
@@ -2,7 +2,7 @@
2#include <linux/crash_dump.h> 2#include <linux/crash_dump.h>
3#include <linux/init.h> 3#include <linux/init.h>
4#include <linux/errno.h> 4#include <linux/errno.h>
5#include <linux/module.h> 5#include <linux/export.h>
6 6
7/* 7/*
8 * If we have booted due to a crash, max_pfn will be a very low value. We need 8 * If we have booted due to a crash, max_pfn will be a very low value. We need
@@ -20,8 +20,15 @@ unsigned long saved_max_pfn;
20unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX; 20unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
21 21
22/* 22/*
23 * stores the size of elf header of crash image
24 */
25unsigned long long elfcorehdr_size;
26
27/*
23 * elfcorehdr= specifies the location of elf core header stored by the crashed 28 * elfcorehdr= specifies the location of elf core header stored by the crashed
24 * kernel. This option will be passed by kexec loader to the capture kernel. 29 * kernel. This option will be passed by kexec loader to the capture kernel.
30 *
31 * Syntax: elfcorehdr=[size[KMG]@]offset[KMG]
25 */ 32 */
26static int __init setup_elfcorehdr(char *arg) 33static int __init setup_elfcorehdr(char *arg)
27{ 34{
@@ -29,6 +36,10 @@ static int __init setup_elfcorehdr(char *arg)
29 if (!arg) 36 if (!arg)
30 return -EINVAL; 37 return -EINVAL;
31 elfcorehdr_addr = memparse(arg, &end); 38 elfcorehdr_addr = memparse(arg, &end);
39 if (*end == '@') {
40 elfcorehdr_size = elfcorehdr_addr;
41 elfcorehdr_addr = memparse(end + 1, &end);
42 }
32 return end > arg ? 0 : -EINVAL; 43 return end > arg ? 0 : -EINVAL;
33} 44}
34early_param("elfcorehdr", setup_elfcorehdr); 45early_param("elfcorehdr", setup_elfcorehdr);