// SPDX-License-Identifier: GPL-2.0-only1#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>67/*8* stores the physical address of elf header of crash image9*10* Note: elfcorehdr_addr is not just limited to vmcore. It is also used by11* is_kdump_kernel() to determine if we are booting after a panic. Hence put12* it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.13*/14unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;15EXPORT_SYMBOL_GPL(elfcorehdr_addr);1617/*18* stores the size of elf header of crash image19*/20unsigned long long elfcorehdr_size;2122/*23* elfcorehdr= specifies the location of elf core header stored by the crashed24* kernel. This option will be passed by kexec loader to the capture kernel.25*26* Syntax: elfcorehdr=[size[KMG]@]offset[KMG]27*/28static int __init setup_elfcorehdr(char *arg)29{30char *end;31if (!arg)32return -EINVAL;33elfcorehdr_addr = memparse(arg, &end);34if (*end == '@') {35elfcorehdr_size = elfcorehdr_addr;36elfcorehdr_addr = memparse(end + 1, &end);37}38return end > arg ? 0 : -EINVAL;39}40early_param("elfcorehdr", setup_elfcorehdr);414243