Skip to content

Commit 7aed3b3

Browse files
committed
sh: shuffle the elfcorehdr handling over to the crash dump code.
The elfcorehdr parsing was just tossed in setup.c, but nothing outside of the crash dump code/vmcore bits require it, so we just move it out of the way, as per ppc. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent aa424bb commit 7aed3b3

2 files changed

Lines changed: 19 additions & 20 deletions

File tree

‎arch/sh/kernel/crash_dump.c‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Created by: Hariprasad Nellitheertha (hari@in.ibm.com)
55
* Copyright (C) IBM Corporation, 2004. All rights reserved
66
*/
7-
87
#include <linux/errno.h>
98
#include <linux/crash_dump.h>
109
#include <linux/io.h>
@@ -13,6 +12,25 @@
1312
/* Stores the physical address of elf header of crash image. */
1413
unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
1514

15+
/*
16+
* Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
17+
* is_kdump_kernel() to determine if we are booting after a panic. Hence
18+
* ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
19+
*
20+
* elfcorehdr= specifies the location of elf core header
21+
* stored by the crashed kernel.
22+
*/
23+
static int __init parse_elfcorehdr(char *arg)
24+
{
25+
if (!arg)
26+
return -EINVAL;
27+
28+
elfcorehdr_addr = memparse(arg, &arg);
29+
30+
return 0;
31+
}
32+
early_param("elfcorehdr", parse_elfcorehdr);
33+
1634
/**
1735
* copy_oldmem_page - copy one page from "oldmem"
1836
* @pfn: page frame number to be copied

‎arch/sh/kernel/setup.c‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -380,25 +380,6 @@ static void __init setup_memory(void)
380380
extern void __init setup_memory(void);
381381
#endif
382382

383-
/*
384-
* Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
385-
* is_kdump_kernel() to determine if we are booting after a panic. Hence
386-
* ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
387-
*/
388-
#ifdef CONFIG_CRASH_DUMP
389-
/* elfcorehdr= specifies the location of elf core header
390-
* stored by the crashed kernel.
391-
*/
392-
static int __init parse_elfcorehdr(char *arg)
393-
{
394-
if (!arg)
395-
return -EINVAL;
396-
elfcorehdr_addr = memparse(arg, &arg);
397-
return 0;
398-
}
399-
early_param("elfcorehdr", parse_elfcorehdr);
400-
#endif
401-
402383
void __init __attribute__ ((weak)) plat_early_device_setup(void)
403384
{
404385
}

0 commit comments

Comments
 (0)