Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Simon Horman and committed by
Paul Mundt
daf423db 623fa579

+20
+20
arch/sh/kernel/setup.c
··· 25 25 #include <linux/smp.h> 26 26 #include <linux/err.h> 27 27 #include <linux/debugfs.h> 28 + #include <linux/crash_dump.h> 28 29 #include <asm/uaccess.h> 29 30 #include <asm/io.h> 30 31 #include <asm/page.h> ··· 285 284 } 286 285 #else 287 286 extern void __init setup_memory(void); 287 + #endif 288 + 289 + /* 290 + * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by 291 + * is_kdump_kernel() to determine if we are booting after a panic. Hence 292 + * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE. 293 + */ 294 + #ifdef CONFIG_CRASH_DUMP 295 + /* elfcorehdr= specifies the location of elf core header 296 + * stored by the crashed kernel. 297 + */ 298 + static int __init parse_elfcorehdr(char *arg) 299 + { 300 + if (!arg) 301 + return -EINVAL; 302 + elfcorehdr_addr = memparse(arg, &arg); 303 + return 0; 304 + } 305 + early_param("elfcorehdr", parse_elfcorehdr); 288 306 #endif 289 307 290 308 void __init setup_arch(char **cmdline_p)