]>
Commit | Line | Data |
---|---|---|
60e64d46 VG |
1 | #ifndef LINUX_CRASH_DUMP_H |
2 | #define LINUX_CRASH_DUMP_H | |
3 | ||
4 | #ifdef CONFIG_CRASH_DUMP | |
5 | #include <linux/kexec.h> | |
6 | #include <linux/smp_lock.h> | |
7 | #include <linux/device.h> | |
8 | #include <linux/proc_fs.h> | |
9 | ||
666bfddb | 10 | #define ELFCORE_ADDR_MAX (-1ULL) |
36ac2617 | 11 | |
2030eae5 | 12 | extern unsigned long long elfcorehdr_addr; |
36ac2617 | 13 | |
60e64d46 VG |
14 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, |
15 | unsigned long, int); | |
4b6f5d20 | 16 | extern const struct file_operations proc_vmcore_operations; |
666bfddb VG |
17 | extern struct proc_dir_entry *proc_vmcore; |
18 | ||
79e03011 IC |
19 | /* Architecture code defines this if there are other possible ELF |
20 | * machine types, e.g. on bi-arch capable hardware. */ | |
21 | #ifndef vmcore_elf_check_arch_cross | |
22 | #define vmcore_elf_check_arch_cross(x) 0 | |
23 | #endif | |
24 | ||
25 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) | |
26 | ||
57cac4d1 VG |
27 | /* |
28 | * is_kdump_kernel() checks whether this kernel is booting after a panic of | |
29 | * previous kernel or not. This is determined by checking if previous kernel | |
30 | * has passed the elf core header address on command line. | |
31 | * | |
32 | * This is not just a test if CONFIG_CRASH_DUMP is enabled or not. It will | |
33 | * return 1 if CONFIG_CRASH_DUMP=y and if kernel is booting after a panic of | |
34 | * previous kernel. | |
35 | */ | |
36 | ||
95b68dec C |
37 | static inline int is_kdump_kernel(void) |
38 | { | |
39 | return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0; | |
40 | } | |
41 | #else /* !CONFIG_CRASH_DUMP */ | |
42 | static inline int is_kdump_kernel(void) { return 0; } | |
60e64d46 | 43 | #endif /* CONFIG_CRASH_DUMP */ |
95b68dec C |
44 | |
45 | extern unsigned long saved_max_pfn; | |
60e64d46 | 46 | #endif /* LINUX_CRASHDUMP_H */ |