blob: 3d1a3af5cf595ccc4e2c9fc5f0060edca1d96272 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_GENERIC_SIGINFO_H
2#define _ASM_GENERIC_SIGINFO_H
3
David Howells8a1ab312012-10-04 18:20:15 +01004#include <uapi/asm-generic/siginfo.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#define __SI_MASK 0xffff0000u
7#define __SI_KILL (0 << 16)
8#define __SI_TIMER (1 << 16)
9#define __SI_POLL (2 << 16)
10#define __SI_FAULT (3 << 16)
11#define __SI_CHLD (4 << 16)
12#define __SI_RT (5 << 16)
13#define __SI_MESGQ (6 << 16)
Will Drewrya0727e82012-04-12 16:48:00 -050014#define __SI_SYS (7 << 16)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#define __SI_CODE(T,N) ((T) | ((N) & 0xffff))
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17struct siginfo;
18void do_schedule_next_timer(struct siginfo *info);
19
20#ifndef HAVE_ARCH_COPY_SIGINFO
21
22#include <linux/string.h>
23
24static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
25{
26 if (from->si_code < 0)
27 memcpy(to, from, sizeof(*to));
28 else
29 /* _sigchld is currently the largest know union member */
30 memcpy(to, from, __ARCH_SI_PREAMBLE_SIZE + sizeof(from->_sifields._sigchld));
31}
32
33#endif
34
Al Viroce395962013-10-13 17:23:53 -040035extern int copy_siginfo_to_user(struct siginfo __user *to, const struct siginfo *from);
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
Linus Torvalds1da177e2005-04-16 15:20:36 -070037#endif