GNU Linux-libre 5.15.54-gnu
[releases.git] / include / linux / coredump.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_COREDUMP_H
3 #define _LINUX_COREDUMP_H
4
5 #include <linux/types.h>
6 #include <linux/mm.h>
7 #include <linux/fs.h>
8 #include <asm/siginfo.h>
9
10 #ifdef CONFIG_COREDUMP
11 struct core_vma_metadata {
12         unsigned long start, end;
13         unsigned long flags;
14         unsigned long dump_size;
15         unsigned long pgoff;
16         struct file   *file;
17 };
18
19 extern int core_uses_pid;
20 extern char core_pattern[];
21 extern unsigned int core_pipe_limit;
22
23 /*
24  * These are the only things you should do on a core-file: use only these
25  * functions to write out all the necessary info.
26  */
27 struct coredump_params;
28 extern void dump_skip_to(struct coredump_params *cprm, unsigned long to);
29 extern void dump_skip(struct coredump_params *cprm, size_t nr);
30 extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr);
31 extern int dump_align(struct coredump_params *cprm, int align);
32 int dump_user_range(struct coredump_params *cprm, unsigned long start,
33                     unsigned long len);
34 extern void do_coredump(const kernel_siginfo_t *siginfo);
35 #else
36 static inline void do_coredump(const kernel_siginfo_t *siginfo) {}
37 #endif
38
39 #endif /* _LINUX_COREDUMP_H */