coredump: rework elf/elf_fdpic vma_dump_size() into common helper
[linux-2.6-microblaze.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 /*
11  * These are the only things you should do on a core-file: use only these
12  * functions to write out all the necessary info.
13  */
14 struct coredump_params;
15 extern int dump_skip(struct coredump_params *cprm, size_t nr);
16 extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr);
17 extern int dump_align(struct coredump_params *cprm, int align);
18 extern void dump_truncate(struct coredump_params *cprm);
19 unsigned long vma_dump_size(struct vm_area_struct *vma, unsigned long mm_flags);
20 int dump_user_range(struct coredump_params *cprm, unsigned long start,
21                     unsigned long len);
22 #ifdef CONFIG_COREDUMP
23 extern void do_coredump(const kernel_siginfo_t *siginfo);
24 #else
25 static inline void do_coredump(const kernel_siginfo_t *siginfo) {}
26 #endif
27
28 extern int core_uses_pid;
29 extern char core_pattern[];
30 extern unsigned int core_pipe_limit;
31
32 #endif /* _LINUX_COREDUMP_H */