#include <linux/kernel.h>1#include <linux/crash_dump.h>2#include <linux/init.h>3#include <linux/errno.h>4#include <linux/module.h>56/*7* If we have booted due to a crash, max_pfn will be a very low value. We need8* to know the amount of memory that the previous kernel used.9*/10unsigned long saved_max_pfn;1112/*13* stores the physical address of elf header of crash image14*15* Note: elfcorehdr_addr is not just limited to vmcore. It is also used by16* is_kdump_kernel() to determine if we are booting after a panic. Hence put17* it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.18*/19unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;2021/*22* elfcorehdr= specifies the location of elf core header stored by the crashed23* kernel. This option will be passed by kexec loader to the capture kernel.24*/25static int __init setup_elfcorehdr(char *arg)26{27char *end;28if (!arg)29return -EINVAL;30elfcorehdr_addr = memparse(arg, &end);31return end > arg ? 0 : -EINVAL;32}33early_param("elfcorehdr", setup_elfcorehdr);343536