aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/siginfo.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-mips/siginfo.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-mips/siginfo.h')
-rw-r--r--include/asm-mips/siginfo.h132
1 files changed, 132 insertions, 0 deletions
diff --git a/include/asm-mips/siginfo.h b/include/asm-mips/siginfo.h
new file mode 100644
index 000000000000..8ddd3c99bcf7
--- /dev/null
+++ b/include/asm-mips/siginfo.h
@@ -0,0 +1,132 @@
1/*
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 _ASM_SIGINFO_H
10#define _ASM_SIGINFO_H
11
12#include <linux/config.h>
13
14#define SIGEV_HEAD_SIZE (sizeof(long) + 2*sizeof(int))
15#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE-SIGEV_HEAD_SIZE) / sizeof(int))
16#undef __ARCH_SI_TRAPNO /* exception code needs to fill this ... */
17
18#define HAVE_ARCH_SIGINFO_T
19
20/*
21 * We duplicate the generic versions - <asm-generic/siginfo.h> is just borked
22 * by design ...
23 */
24#define HAVE_ARCH_COPY_SIGINFO
25struct siginfo;
26
27/*
28 * Careful to keep union _sifields from shifting ...
29 */
30#ifdef CONFIG_MIPS32
31#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
32#endif
33#ifdef CONFIG_MIPS64
34#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
35#endif
36
37#include <asm-generic/siginfo.h>
38
39typedef struct siginfo {
40 int si_signo;
41 int si_code;
42 int si_errno;
43 int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
44
45 union {
46 int _pad[SI_PAD_SIZE];
47
48 /* kill() */
49 struct {
50 pid_t _pid; /* sender's pid */
51 __ARCH_SI_UID_T _uid; /* sender's uid */
52 } _kill;
53
54 /* POSIX.1b timers */
55 struct {
56 timer_t _tid; /* timer id */
57 int _overrun; /* overrun count */
58 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
59 sigval_t _sigval; /* same as below */
60 int _sys_private; /* not to be passed to user */
61 } _timer;
62
63 /* POSIX.1b signals */
64 struct {
65 pid_t _pid; /* sender's pid */
66 __ARCH_SI_UID_T _uid; /* sender's uid */
67 sigval_t _sigval;
68 } _rt;
69
70 /* SIGCHLD */
71 struct {
72 pid_t _pid; /* which child */
73 __ARCH_SI_UID_T _uid; /* sender's uid */
74 int _status; /* exit code */
75 clock_t _utime;
76 clock_t _stime;
77 } _sigchld;
78
79 /* IRIX SIGCHLD */
80 struct {
81 pid_t _pid; /* which child */
82 clock_t _utime;
83 int _status; /* exit code */
84 clock_t _stime;
85 } _irix_sigchld;
86
87 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
88 struct {
89 void __user *_addr; /* faulting insn/memory ref. */
90#ifdef __ARCH_SI_TRAPNO
91 int _trapno; /* TRAP # which caused the signal */
92#endif
93 } _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;
100 } _sifields;
101} siginfo_t;
102
103/*
104 * si_code values
105 * Again these have been choosen to be IRIX compatible.
106 */
107#undef SI_ASYNCIO
108#undef SI_TIMER
109#undef SI_MESGQ
110#define SI_ASYNCIO -2 /* sent by AIO completion */
111#define SI_TIMER __SI_CODE(__SI_TIMER,-3) /* sent by timer expiration */
112#define SI_MESGQ __SI_CODE(__SI_MESGQ,-4) /* sent by real time mesq state change */
113
114#ifdef __KERNEL__
115
116/*
117 * Duplicated here because of <asm-generic/siginfo.h> braindamage ...
118 */
119#include <linux/string.h>
120
121static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
122{
123 if (from->si_code < 0)
124 memcpy(to, from, sizeof(*to));
125 else
126 /* _sigchld is currently the largest know union member */
127 memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
128}
129
130#endif
131
132#endif /* _ASM_SIGINFO_H */