blob: f0b71a74d0bccf11d43e6bdb3a26d1c8daba994c [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Daisuke HATAYAMA088e7af2010-03-05 13:44:06 -08002#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>
Richard Weinberger1d46e232012-10-19 13:56:47 -07008#include <asm/siginfo.h>
Daisuke HATAYAMA088e7af2010-03-05 13:44:06 -08009
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 */
Al Viroecc8c772013-10-05 15:32:35 -040014struct coredump_params;
Al Viro9b56d542013-10-08 09:26:08 -040015extern int dump_skip(struct coredump_params *cprm, size_t nr);
Al Viroecc8c772013-10-05 15:32:35 -040016extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr);
Al Viro22a8cb82013-10-08 11:05:01 -040017extern int dump_align(struct coredump_params *cprm, int align);
Dave Kleikamp4d22c752017-01-11 13:25:00 -060018extern void dump_truncate(struct coredump_params *cprm);
Jann Hornafc63a97b2020-10-15 20:12:46 -070019int dump_user_range(struct coredump_params *cprm, unsigned long start,
20 unsigned long len);
Alex Kelly179899fd2012-10-04 17:15:24 -070021#ifdef CONFIG_COREDUMP
Eric W. Biedermanae7795b2018-09-25 11:27:20 +020022extern void do_coredump(const kernel_siginfo_t *siginfo);
Alex Kelly179899fd2012-10-04 17:15:24 -070023#else
Eric W. Biedermanae7795b2018-09-25 11:27:20 +020024static inline void do_coredump(const kernel_siginfo_t *siginfo) {}
Alex Kelly179899fd2012-10-04 17:15:24 -070025#endif
Daisuke HATAYAMA088e7af2010-03-05 13:44:06 -080026
Christoph Hellwig2374c09b2020-04-24 08:43:36 +020027extern int core_uses_pid;
28extern char core_pattern[];
29extern unsigned int core_pipe_limit;
30
Daisuke HATAYAMA088e7af2010-03-05 13:44:06 -080031#endif /* _LINUX_COREDUMP_H */