1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef LINUX_CRASH_RESERVE_H
3 #define LINUX_CRASH_RESERVE_H
5 #include <linux/linkage.h>
6 #include <linux/elfcore.h>
8 #ifdef CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION
9 #include <asm/crash_reserve.h>
12 /* Location of a reserved region to hold the crash kernel.
14 extern struct resource crashk_res;
15 extern struct resource crashk_low_res;
17 int __init parse_crashkernel(char *cmdline, unsigned long long system_ram,
18 unsigned long long *crash_size, unsigned long long *crash_base,
19 unsigned long long *low_size, bool *high);
21 #ifdef CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION
22 #ifndef DEFAULT_CRASH_KERNEL_LOW_SIZE
23 #define DEFAULT_CRASH_KERNEL_LOW_SIZE (128UL << 20)
26 #define CRASH_ALIGN SZ_2M
28 #ifndef CRASH_ADDR_LOW_MAX
29 #define CRASH_ADDR_LOW_MAX SZ_4G
31 #ifndef CRASH_ADDR_HIGH_MAX
32 #define CRASH_ADDR_HIGH_MAX memblock_end_of_DRAM()
35 void __init reserve_crashkernel_generic(char *cmdline,
36 unsigned long long crash_size,
37 unsigned long long crash_base,
38 unsigned long long crash_low_size,
41 static inline void __init reserve_crashkernel_generic(char *cmdline,
42 unsigned long long crash_size,
43 unsigned long long crash_base,
44 unsigned long long crash_low_size,
48 #endif /* LINUX_CRASH_RESERVE_H */