Vivek Goyal | 60e64d4 | 2005-06-25 14:58:19 -0700 | [diff] [blame] | 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 | |
Vivek Goyal | 666bfdd | 2005-06-25 14:58:21 -0700 | [diff] [blame] | 10 | #define ELFCORE_ADDR_MAX (-1ULL) |
Ingo Molnar | 36ac261 | 2008-07-26 11:22:33 +0200 | [diff] [blame] | 11 | |
| 12 | #ifdef CONFIG_PROC_VMCORE |
Vivek Goyal | 2030eae | 2005-06-25 14:58:20 -0700 | [diff] [blame] | 13 | extern unsigned long long elfcorehdr_addr; |
Ingo Molnar | 36ac261 | 2008-07-26 11:22:33 +0200 | [diff] [blame] | 14 | #else |
| 15 | static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX; |
| 16 | #endif |
| 17 | |
Vivek Goyal | 60e64d4 | 2005-06-25 14:58:19 -0700 | [diff] [blame] | 18 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, |
| 19 | unsigned long, int); |
Arjan van de Ven | 4b6f5d2 | 2006-03-28 01:56:42 -0800 | [diff] [blame] | 20 | extern const struct file_operations proc_vmcore_operations; |
Vivek Goyal | 666bfdd | 2005-06-25 14:58:21 -0700 | [diff] [blame] | 21 | extern struct proc_dir_entry *proc_vmcore; |
| 22 | |
Ian Campbell | 79e0301 | 2007-05-02 19:27:09 +0200 | [diff] [blame] | 23 | /* Architecture code defines this if there are other possible ELF |
| 24 | * machine types, e.g. on bi-arch capable hardware. */ |
| 25 | #ifndef vmcore_elf_check_arch_cross |
| 26 | #define vmcore_elf_check_arch_cross(x) 0 |
| 27 | #endif |
| 28 | |
| 29 | #define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x)) |
| 30 | |
Chandru | 95b68de | 2008-07-25 01:47:55 -0700 | [diff] [blame] | 31 | static inline int is_kdump_kernel(void) |
| 32 | { |
| 33 | return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0; |
| 34 | } |
| 35 | #else /* !CONFIG_CRASH_DUMP */ |
| 36 | static inline int is_kdump_kernel(void) { return 0; } |
Vivek Goyal | 60e64d4 | 2005-06-25 14:58:19 -0700 | [diff] [blame] | 37 | #endif /* CONFIG_CRASH_DUMP */ |
Chandru | 95b68de | 2008-07-25 01:47:55 -0700 | [diff] [blame] | 38 | |
| 39 | extern unsigned long saved_max_pfn; |
Vivek Goyal | 60e64d4 | 2005-06-25 14:58:19 -0700 | [diff] [blame] | 40 | #endif /* LINUX_CRASHDUMP_H */ |