Linux Audio

Check our new training course

Loading...
v6.2
 1// SPDX-License-Identifier: GPL-2.0-only
 2#include <linux/kernel.h>
 3#include <linux/crash_dump.h>
 4#include <linux/init.h>
 5#include <linux/errno.h>
 6#include <linux/export.h>
 
 
 
 
 
 
 7
 8/*
 9 * stores the physical address of elf header of crash image
10 *
11 * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
12 * is_kdump_kernel() to determine if we are booting after a panic. Hence put
13 * it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
14 */
15unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
16EXPORT_SYMBOL_GPL(elfcorehdr_addr);
17
18/*
19 * stores the size of elf header of crash image
20 */
21unsigned long long elfcorehdr_size;
22
23/*
24 * elfcorehdr= specifies the location of elf core header stored by the crashed
25 * kernel. This option will be passed by kexec loader to the capture kernel.
26 *
27 * Syntax: elfcorehdr=[size[KMG]@]offset[KMG]
28 */
29static int __init setup_elfcorehdr(char *arg)
30{
31	char *end;
32	if (!arg)
33		return -EINVAL;
34	elfcorehdr_addr = memparse(arg, &end);
35	if (*end == '@') {
36		elfcorehdr_size = elfcorehdr_addr;
37		elfcorehdr_addr = memparse(end + 1, &end);
38	}
39	return end > arg ? 0 : -EINVAL;
40}
41early_param("elfcorehdr", setup_elfcorehdr);
v4.17
 
 1#include <linux/kernel.h>
 2#include <linux/crash_dump.h>
 3#include <linux/init.h>
 4#include <linux/errno.h>
 5#include <linux/export.h>
 6
 7/*
 8 * If we have booted due to a crash, max_pfn will be a very low value. We need
 9 * to know the amount of memory that the previous kernel used.
10 */
11unsigned long saved_max_pfn;
12
13/*
14 * stores the physical address of elf header of crash image
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 put
18 * it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
19 */
20unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
21EXPORT_SYMBOL_GPL(elfcorehdr_addr);
22
23/*
24 * stores the size of elf header of crash image
25 */
26unsigned long long elfcorehdr_size;
27
28/*
29 * elfcorehdr= specifies the location of elf core header stored by the crashed
30 * kernel. This option will be passed by kexec loader to the capture kernel.
31 *
32 * Syntax: elfcorehdr=[size[KMG]@]offset[KMG]
33 */
34static int __init setup_elfcorehdr(char *arg)
35{
36	char *end;
37	if (!arg)
38		return -EINVAL;
39	elfcorehdr_addr = memparse(arg, &end);
40	if (*end == '@') {
41		elfcorehdr_size = elfcorehdr_addr;
42		elfcorehdr_addr = memparse(end + 1, &end);
43	}
44	return end > arg ? 0 : -EINVAL;
45}
46early_param("elfcorehdr", setup_elfcorehdr);