blob: d08f83f19db566899298e41ac06bf53f3a757400 [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/*
19 * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
20 * by design ...
21 */
22#define HAVE_ARCH_COPY_SIGINFO
23struct siginfo;
24
25/*
26 * Careful to keep union _sifields from shifting ...
27 */
Maciej W. Rozycki1d3e2d72013-07-28 21:20:25 +010028#if _MIPS_SZLONG == 32
David Howells61730c52012-10-09 09:47:14 +010029#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
Maciej W. Rozycki1d3e2d72013-07-28 21:20:25 +010030#elif _MIPS_SZLONG == 64
David Howells61730c52012-10-09 09:47:14 +010031#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
Maciej W. Rozycki1d3e2d72013-07-28 21:20:25 +010032#else
33#error _MIPS_SZLONG neither 32 nor 64
David Howells61730c52012-10-09 09:47:14 +010034#endif
35
Ralf Baechle51d139b2012-07-12 17:13:15 +020036#define __ARCH_SIGSYS
37
David Howells61730c52012-10-09 09:47:14 +010038#include <asm-generic/siginfo.h>
39
40typedef struct siginfo {
41 int si_signo;
42 int si_code;
43 int si_errno;
44 int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
45
46 union {
47 int _pad[SI_PAD_SIZE];
48
49 /* kill() */
50 struct {
51 pid_t _pid; /* sender's pid */
52 __ARCH_SI_UID_T _uid; /* sender's uid */
53 } _kill;
54
55 /* POSIX.1b timers */
56 struct {
57 timer_t _tid; /* timer id */
58 int _overrun; /* overrun count */
59 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
60 sigval_t _sigval; /* same as below */
Ralf Baechle70342282013-01-22 12:59:30 +010061 int _sys_private; /* not to be passed to user */
David Howells61730c52012-10-09 09:47:14 +010062 } _timer;
63
64 /* POSIX.1b signals */
65 struct {
66 pid_t _pid; /* sender's pid */
67 __ARCH_SI_UID_T _uid; /* sender's uid */
68 sigval_t _sigval;
69 } _rt;
70
71 /* SIGCHLD */
72 struct {
73 pid_t _pid; /* which child */
74 __ARCH_SI_UID_T _uid; /* sender's uid */
75 int _status; /* exit code */
76 clock_t _utime;
77 clock_t _stime;
78 } _sigchld;
79
80 /* IRIX SIGCHLD */
81 struct {
82 pid_t _pid; /* which child */
83 clock_t _utime;
84 int _status; /* exit code */
85 clock_t _stime;
86 } _irix_sigchld;
87
88 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
89 struct {
90 void __user *_addr; /* faulting insn/memory ref. */
91#ifdef __ARCH_SI_TRAPNO
92 int _trapno; /* TRAP # which caused the signal */
93#endif
94 short _addr_lsb;
Qiaowei Ren232b5ff2014-11-14 07:18:20 -080095 struct {
96 void __user *_lower;
97 void __user *_upper;
98 } _addr_bnd;
David Howells61730c52012-10-09 09:47:14 +010099 } _sigfault;
100
Ralf Baechle70342282013-01-22 12:59:30 +0100101 /* SIGPOLL, SIGXFSZ (To do ...) */
David Howells61730c52012-10-09 09:47:14 +0100102 struct {
Ralf Baechle70342282013-01-22 12:59:30 +0100103 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
David Howells61730c52012-10-09 09:47:14 +0100104 int _fd;
105 } _sigpoll;
Ralf Baechle51d139b2012-07-12 17:13:15 +0200106
107 /* SIGSYS */
108 struct {
109 void __user *_call_addr; /* calling user insn */
110 int _syscall; /* triggering system call number */
111 unsigned int _arch; /* AUDIT_ARCH_* of syscall */
112 } _sigsys;
David Howells61730c52012-10-09 09:47:14 +0100113 } _sifields;
114} siginfo_t;
115
116/*
117 * si_code values
118 * Again these have been chosen to be IRIX compatible.
119 */
120#undef SI_ASYNCIO
121#undef SI_TIMER
122#undef SI_MESGQ
123#define SI_ASYNCIO -2 /* sent by AIO completion */
124#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
125#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
126
127
128#endif /* _UAPI_ASM_SIGINFO_H */