blob: 2cb7fdead5702a5c8b5f0522e0c9f3e8e4ee96ba [file] [log] [blame]
Christopher Ferris19808422013-11-07 14:54:38 -08001/*
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))
14#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
15
16#define HAVE_ARCH_SIGINFO_T
17
18/*
Christopher Ferris19808422013-11-07 14:54:38 -080019 * Careful to keep union _sifields from shifting ...
20 */
Christopher Ferrise0845012014-07-09 14:58:51 -070021#if _MIPS_SZLONG == 32
Christopher Ferris19808422013-11-07 14:54:38 -080022#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
Christopher Ferrise0845012014-07-09 14:58:51 -070023#elif _MIPS_SZLONG == 64
Christopher Ferris19808422013-11-07 14:54:38 -080024#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
Christopher Ferrise0845012014-07-09 14:58:51 -070025#else
26#error _MIPS_SZLONG neither 32 nor 64
Christopher Ferris19808422013-11-07 14:54:38 -080027#endif
28
Christopher Ferrise0845012014-07-09 14:58:51 -070029#define __ARCH_SIGSYS
30
Christopher Ferris12e1f282016-02-04 12:35:07 -080031#include <uapi/asm-generic/siginfo.h>
Christopher Ferris19808422013-11-07 14:54:38 -080032
Christopher Ferris12e1f282016-02-04 12:35:07 -080033/* We can't use generic siginfo_t, because our si_code and si_errno are swapped */
Christopher Ferris19808422013-11-07 14:54:38 -080034typedef 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 {
45 pid_t _pid; /* sender's pid */
46 __ARCH_SI_UID_T _uid; /* sender's uid */
47 } _kill;
48
49 /* POSIX.1b timers */
50 struct {
51 timer_t _tid; /* timer id */
52 int _overrun; /* overrun count */
53 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
54 sigval_t _sigval; /* same as below */
55 int _sys_private; /* not to be passed to user */
56 } _timer;
57
58 /* POSIX.1b signals */
59 struct {
60 pid_t _pid; /* sender's pid */
61 __ARCH_SI_UID_T _uid; /* sender's uid */
62 sigval_t _sigval;
63 } _rt;
64
65 /* SIGCHLD */
66 struct {
67 pid_t _pid; /* which child */
68 __ARCH_SI_UID_T _uid; /* sender's uid */
69 int _status; /* exit code */
70 clock_t _utime;
71 clock_t _stime;
72 } _sigchld;
73
74 /* IRIX SIGCHLD */
75 struct {
76 pid_t _pid; /* which child */
77 clock_t _utime;
78 int _status; /* exit code */
79 clock_t _stime;
80 } _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;
Christopher Ferris12e1f282016-02-04 12:35:07 -080089 struct {
90 void __user *_lower;
91 void __user *_upper;
92 } _addr_bnd;
Christopher Ferris19808422013-11-07 14:54:38 -080093 } _sigfault;
94
95 /* SIGPOLL, SIGXFSZ (To do ...) */
96 struct {
97 __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */
98 int _fd;
99 } _sigpoll;
Christopher Ferrise0845012014-07-09 14:58:51 -0700100
101 /* SIGSYS */
102 struct {
103 void __user *_call_addr; /* calling user insn */
104 int _syscall; /* triggering system call number */
105 unsigned int _arch; /* AUDIT_ARCH_* of syscall */
106 } _sigsys;
Christopher Ferris19808422013-11-07 14:54:38 -0800107 } _sifields;
108} siginfo_t;
109
110/*
111 * si_code values
112 * Again these have been chosen to be IRIX compatible.
113 */
114#undef SI_ASYNCIO
115#undef SI_TIMER
116#undef SI_MESGQ
117#define SI_ASYNCIO -2 /* sent by AIO completion */
118#define SI_TIMER __SI_CODE(__SI_TIMER, -3) /* sent by timer expiration */
119#define SI_MESGQ __SI_CODE(__SI_MESGQ, -4) /* sent by real time mesq state change */
120
Christopher Ferris12e1f282016-02-04 12:35:07 -0800121#include <asm-generic/siginfo.h>
Christopher Ferris19808422013-11-07 14:54:38 -0800122
123#endif /* _UAPI_ASM_SIGINFO_H */