blob: 8069cf766603ea3e2e5f090bab3e6547a7ac46b6 [file] [log] [blame]
David Howells61730c52012-10-09 09:47:14 +01001/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1998, 1999, 2001, 2003 Ralf Baechle
7 * Copyright (C) 2000, 2001 Silicon Graphics, Inc.
8 */
9#ifndef _UAPI_ASM_SIGINFO_H
10#define _UAPI_ASM_SIGINFO_H
11
12
13#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(long) + 2*sizeof(int))
Ralf Baechle70342282013-01-22 12:59:30 +010014#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
David Howells61730c52012-10-09 09:47:14 +010015
16#define HAVE_ARCH_SIGINFO_T
17
18/*
David Howells61730c52012-10-09 09:47:14 +010019 * Careful to keep union _sifields from shifting ...
20 */
Maciej W. Rozycki1d3e2d72013-07-28 21:20:25 +010021#if _MIPS_SZLONG == 32
David Howells61730c52012-10-09 09:47:14 +010022#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
Maciej W. Rozycki1d3e2d72013-07-28 21:20:25 +010023#elif _MIPS_SZLONG == 64
David Howells61730c52012-10-09 09:47:14 +010024#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
Maciej W. Rozycki1d3e2d72013-07-28 21:20:25 +010025#else
26#error _MIPS_SZLONG neither 32 nor 64
David Howells61730c52012-10-09 09:47:14 +010027#endif
28
Ralf Baechle51d139b2012-07-12 17:13:15 +020029#define __ARCH_SIGSYS
30
James Hogan987e5b82016-02-08 18:43:51 +000031#include <asm-generic/siginfo.h>
David Howells61730c52012-10-09 09:47:14 +010032
Petr Malat8cb48fe12014-12-12 15:28:01 +010033/* We can't use generic siginfo_t, because our si_code and si_errno are swapped */
David Howells61730c52012-10-09 09:47:14 +010034typedef struct siginfo {
35 int si_signo;
36 int si_code;
37 int si_errno;
38 int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
39
40 union {
41 int _pad[SI_PAD_SIZE];
42
43 /* kill() */
44 struct {
James Hogan5daebc42016-02-08 18:43:49 +000045 __kernel_pid_t _pid; /* sender's pid */
David Howells61730c52012-10-09 09:47:14 +010046 __ARCH_SI_UID_T _uid; /* sender's uid */
47 } _kill;
48
49 /* POSIX.1b timers */
50 struct {
James Hogan5daebc42016-02-08 18:43:49 +000051 __kernel_timer_t _tid; /* timer id */
David Howells61730c52012-10-09 09:47:14 +010052 int _overrun; /* overrun count */
53 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
54 sigval_t _sigval; /* same as below */
Ralf Baechle70342282013-01-22 12:59:30 +010055 int _sys_private; /* not to be passed to user */
David Howells61730c52012-10-09 09:47:14 +010056 } _timer;
57
58 /* POSIX.1b signals */
59 struct {
James Hogan5daebc42016-02-08 18:43:49 +000060 __kernel_pid_t _pid; /* sender's pid */
David Howells61730c52012-10-09 09:47:14 +010061 __ARCH_SI_UID_T _uid; /* sender's uid */
62 sigval_t _sigval;
63 } _rt;
64
65 /* SIGCHLD */
66 struct {
James Hogan5daebc42016-02-08 18:43:49 +000067 __kernel_pid_t _pid; /* which child */
David Howells61730c52012-10-09 09:47:14 +010068 __ARCH_SI_UID_T _uid; /* sender's uid */
69 int _status; /* exit code */
James Hogan5daebc42016-02-08 18:43:49 +000070 __kernel_clock_t _utime;
71 __kernel_clock_t _stime;
David Howells61730c52012-10-09 09:47:14 +010072 } _sigchld;
73
74 /* IRIX SIGCHLD */
75 struct {
James Hogan5daebc42016-02-08 18:43:49 +000076 __kernel_pid_t _pid; /* which child */
77 __kernel_clock_t _utime;
David Howells61730c52012-10-09 09:47:14 +010078 int _status; /* exit code */
James Hogan5daebc42016-02-08 18:43:49 +000079 __kernel_clock_t _stime;
David Howells61730c52012-10-09 09:47:14 +010080 } _irix_sigchld;
81
82 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
83 struct {
84 void __user *_addr; /* faulting insn/memory ref. */
85#ifdef __ARCH_SI_TRAPNO
86 int _trapno; /* TRAP # which caused the signal */
87#endif
88 short _addr_lsb;
Dave Hansenb376cd02016-02-17 10:17:03 -080089 union {
90 /* used when si_code=SEGV_BNDERR */
91 struct {
92 void __user *_lower;
93 void __user *_upper;
94 } _addr_bnd;
95 /* used when si_code=SEGV_PKUERR */
Dave Hansen49cd53b2016-03-01 04:54:51 -080096 __u32 _pkey;
Dave Hansenb376cd02016-02-17 10:17:03 -080097 };
David Howells61730c52012-10-09 09:47:14 +010098 } _sigfault;
99
Ralf Baechle70342282013-01-22 12:59:30 +0100100 /* SIGPOLL, SIGXFSZ (To do ...) */
David Howells61730c52012-10-09 09:47:14 +0100101 struct {
Ralf Baechle70342282013-01-22 12:59:30 +0100102 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
David Howells61730c52012-10-09 09:47:14 +0100103 int _fd;
104 } _sigpoll;
Ralf Baechle51d139b2012-07-12 17:13:15 +0200105
106 /* SIGSYS */
107 struct {
108 void __user *_call_addr; /* calling user insn */
109 int _syscall; /* triggering system call number */
110 unsigned int _arch; /* AUDIT_ARCH_* of syscall */
111 } _sigsys;
David Howells61730c52012-10-09 09:47:14 +0100112 } _sifields;
113} siginfo_t;
114
115/*
116 * si_code values
117 * Again these have been chosen to be IRIX compatible.
118 */
119#undef SI_ASYNCIO
120#undef SI_TIMER
121#undef SI_MESGQ
122#define SI_ASYNCIO -2 /* sent by AIO completion */
123#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
124#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
125
David Howells61730c52012-10-09 09:47:14 +0100126#endif /* _UAPI_ASM_SIGINFO_H */