Skip to content

Commit daf423d

Browse files
hormspmundt
authored andcommitted
kdump: sh: parse elfcorehdr command line argument
A quick cut and paste from other architectures to allow SH to parse the elfcorehdr command line argument which is required for both is_kdump_kernel() and vmcore to function. (the former is as yet unused on SH). Tested compilation only Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 623fa57 commit daf423d

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎arch/sh/kernel/setup.c‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/smp.h>
2626
#include <linux/err.h>
2727
#include <linux/debugfs.h>
28+
#include <linux/crash_dump.h>
2829
#include <asm/uaccess.h>
2930
#include <asm/io.h>
3031
#include <asm/page.h>
@@ -286,6 +287,25 @@ static void __init setup_memory(void)
286287
extern void __init setup_memory(void);
287288
#endif
288289

290+
/*
291+
* Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
292+
* is_kdump_kernel() to determine if we are booting after a panic. Hence
293+
* ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
294+
*/
295+
#ifdef CONFIG_CRASH_DUMP
296+
/* elfcorehdr= specifies the location of elf core header
297+
* stored by the crashed kernel.
298+
*/
299+
static int __init parse_elfcorehdr(char *arg)
300+
{
301+
if (!arg)
302+
return -EINVAL;
303+
elfcorehdr_addr = memparse(arg, &arg);
304+
return 0;
305+
}
306+
early_param("elfcorehdr", parse_elfcorehdr);
307+
#endif
308+
289309
void __init setup_arch(char **cmdline_p)
290310
{
291311
enable_mmu();

0 commit comments

Comments
 (0)