~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/crash_core.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef LINUX_CRASH_CORE_H
  3 #define LINUX_CRASH_CORE_H
  4 
  5 #include <linux/linkage.h>
  6 #include <linux/elfcore.h>
  7 #include <linux/elf.h>
  8 
  9 struct kimage;
 10 
 11 struct crash_mem {
 12         unsigned int max_nr_ranges;
 13         unsigned int nr_ranges;
 14         struct range ranges[] __counted_by(max_nr_ranges);
 15 };
 16 
 17 #ifdef CONFIG_CRASH_DUMP
 18 
 19 int crash_shrink_memory(unsigned long new_size);
 20 ssize_t crash_get_memory_size(void);
 21 
 22 #ifndef arch_kexec_protect_crashkres
 23 /*
 24  * Protection mechanism for crashkernel reserved memory after
 25  * the kdump kernel is loaded.
 26  *
 27  * Provide an empty default implementation here -- architecture
 28  * code may override this
 29  */
 30 static inline void arch_kexec_protect_crashkres(void) { }
 31 #endif
 32 
 33 #ifndef arch_kexec_unprotect_crashkres
 34 static inline void arch_kexec_unprotect_crashkres(void) { }
 35 #endif
 36 
 37 
 38 
 39 #ifndef arch_crash_handle_hotplug_event
 40 static inline void arch_crash_handle_hotplug_event(struct kimage *image, void *arg) { }
 41 #endif
 42 
 43 int crash_check_hotplug_support(void);
 44 
 45 #ifndef arch_crash_hotplug_support
 46 static inline int arch_crash_hotplug_support(struct kimage *image, unsigned long kexec_flags)
 47 {
 48         return 0;
 49 }
 50 #endif
 51 
 52 #ifndef crash_get_elfcorehdr_size
 53 static inline unsigned int crash_get_elfcorehdr_size(void) { return 0; }
 54 #endif
 55 
 56 /* Alignment required for elf header segment */
 57 #define ELF_CORE_HEADER_ALIGN   4096
 58 
 59 extern int crash_exclude_mem_range(struct crash_mem *mem,
 60                                    unsigned long long mstart,
 61                                    unsigned long long mend);
 62 extern int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map,
 63                                        void **addr, unsigned long *sz);
 64 
 65 struct kimage;
 66 struct kexec_segment;
 67 
 68 #define KEXEC_CRASH_HP_NONE                     0
 69 #define KEXEC_CRASH_HP_ADD_CPU                  1
 70 #define KEXEC_CRASH_HP_REMOVE_CPU               2
 71 #define KEXEC_CRASH_HP_ADD_MEMORY               3
 72 #define KEXEC_CRASH_HP_REMOVE_MEMORY            4
 73 #define KEXEC_CRASH_HP_INVALID_CPU              -1U
 74 
 75 extern void __crash_kexec(struct pt_regs *regs);
 76 extern void crash_kexec(struct pt_regs *regs);
 77 int kexec_should_crash(struct task_struct *p);
 78 int kexec_crash_loaded(void);
 79 void crash_save_cpu(struct pt_regs *regs, int cpu);
 80 extern int kimage_crash_copy_vmcoreinfo(struct kimage *image);
 81 
 82 #else /* !CONFIG_CRASH_DUMP*/
 83 struct pt_regs;
 84 struct task_struct;
 85 struct kimage;
 86 static inline void __crash_kexec(struct pt_regs *regs) { }
 87 static inline void crash_kexec(struct pt_regs *regs) { }
 88 static inline int kexec_should_crash(struct task_struct *p) { return 0; }
 89 static inline int kexec_crash_loaded(void) { return 0; }
 90 static inline void crash_save_cpu(struct pt_regs *regs, int cpu) {};
 91 static inline int kimage_crash_copy_vmcoreinfo(struct kimage *image) { return 0; };
 92 #endif /* CONFIG_CRASH_DUMP*/
 93 
 94 #endif /* LINUX_CRASH_CORE_H */
 95 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php