linux_signal.h revision 1.3.6.7 1 1.3.6.7 thorpej /* $NetBSD: linux_signal.h,v 1.3.6.7 2002/12/11 06:37:21 thorpej Exp $ */
2 1.3.6.2 nathanw
3 1.3.6.2 nathanw /*-
4 1.3.6.2 nathanw * Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
5 1.3.6.2 nathanw * All rights reserved.
6 1.3.6.2 nathanw *
7 1.3.6.2 nathanw * This code is derived from software contributed to The NetBSD Foundation
8 1.3.6.2 nathanw * by Frank van der Linden, Eric Haszlakiewicz and Emmanuel Dreyfus.
9 1.3.6.2 nathanw *
10 1.3.6.2 nathanw * Redistribution and use in source and binary forms, with or without
11 1.3.6.2 nathanw * modification, are permitted provided that the following conditions
12 1.3.6.2 nathanw * are met:
13 1.3.6.2 nathanw * 1. Redistributions of source code must retain the above copyright
14 1.3.6.2 nathanw * notice, this list of conditions and the following disclaimer.
15 1.3.6.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
16 1.3.6.2 nathanw * notice, this list of conditions and the following disclaimer in the
17 1.3.6.2 nathanw * documentation and/or other materials provided with the distribution.
18 1.3.6.2 nathanw * 3. All advertising materials mentioning features or use of this software
19 1.3.6.2 nathanw * must display the following acknowledgement:
20 1.3.6.2 nathanw * This product includes software developed by the NetBSD
21 1.3.6.2 nathanw * Foundation, Inc. and its contributors.
22 1.3.6.2 nathanw * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.3.6.2 nathanw * contributors may be used to endorse or promote products derived
24 1.3.6.2 nathanw * from this software without specific prior written permission.
25 1.3.6.2 nathanw *
26 1.3.6.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.3.6.2 nathanw * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.3.6.2 nathanw * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.3.6.2 nathanw * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.3.6.2 nathanw * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.3.6.2 nathanw * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.3.6.2 nathanw * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.3.6.2 nathanw * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.3.6.2 nathanw * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.3.6.2 nathanw * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.3.6.2 nathanw * POSSIBILITY OF SUCH DAMAGE.
37 1.3.6.2 nathanw */
38 1.3.6.2 nathanw
39 1.3.6.2 nathanw #ifndef _MIPS_LINUX_SIGNAL_H
40 1.3.6.2 nathanw #define _MIPS_LINUX_SIGNAL_H
41 1.3.6.2 nathanw
42 1.3.6.3 nathanw /*
43 1.3.6.3 nathanw * From Linux's include/asm-mips/ptrace.h
44 1.3.6.3 nathanw */
45 1.3.6.3 nathanw struct linux_pt_regs {
46 1.3.6.3 nathanw unsigned long lpad0[6];
47 1.3.6.3 nathanw unsigned long lregs[32];
48 1.3.6.3 nathanw unsigned long llo;
49 1.3.6.3 nathanw unsigned long lhi;
50 1.3.6.4 nathanw unsigned long lcp0_epc;
51 1.3.6.3 nathanw unsigned long lcp0_badvaddr;
52 1.3.6.3 nathanw unsigned long lcp0_status;
53 1.3.6.3 nathanw unsigned long lcp0_cause;
54 1.3.6.3 nathanw };
55 1.3.6.3 nathanw
56 1.3.6.2 nathanw /*
57 1.3.6.2 nathanw * Everything is from Linux's include/asm-mips/signal.h
58 1.3.6.2 nathanw */
59 1.3.6.2 nathanw #define LINUX_SIGHUP 1
60 1.3.6.2 nathanw #define LINUX_SIGINT 2
61 1.3.6.2 nathanw #define LINUX_SIGQUIT 3
62 1.3.6.2 nathanw #define LINUX_SIGILL 4
63 1.3.6.2 nathanw #define LINUX_SIGTRAP 5
64 1.3.6.2 nathanw #define LINUX_SIGABRT 6
65 1.3.6.2 nathanw #define LINUX_SIGIOT 6
66 1.3.6.2 nathanw #define LINUX_SIGEMT 7
67 1.3.6.2 nathanw #define LINUX_SIGFPE 8
68 1.3.6.2 nathanw #define LINUX_SIGKILL 9
69 1.3.6.2 nathanw #define LINUX_SIGBUS 10
70 1.3.6.2 nathanw #define LINUX_SIGSEGV 11
71 1.3.6.2 nathanw #define LINUX_SIGSYS 12
72 1.3.6.2 nathanw #define LINUX_SIGPIPE 13
73 1.3.6.2 nathanw #define LINUX_SIGALRM 14
74 1.3.6.2 nathanw #define LINUX_SIGTERM 15
75 1.3.6.2 nathanw #define LINUX_SIGUSR1 16
76 1.3.6.2 nathanw #define LINUX_SIGUSR2 17
77 1.3.6.2 nathanw #define LINUX_SIGCHLD 18
78 1.3.6.2 nathanw #define LINUX_SIGCLD 18
79 1.3.6.2 nathanw #define LINUX_SIGPWR 19
80 1.3.6.2 nathanw #define LINUX_SIGWINCH 20
81 1.3.6.2 nathanw #define LINUX_SIGURG 21
82 1.3.6.2 nathanw #define LINUX_SIGIO 22
83 1.3.6.2 nathanw #define LINUX_SIGPOLL 22
84 1.3.6.2 nathanw #define LINUX_SIGSTOP 23
85 1.3.6.2 nathanw #define LINUX_SIGTSTP 24
86 1.3.6.2 nathanw #define LINUX_SIGCONT 25
87 1.3.6.2 nathanw #define LINUX_SIGTTIN 26
88 1.3.6.2 nathanw #define LINUX_SIGTTOU 27
89 1.3.6.2 nathanw #define LINUX_SIGVTALRM 28
90 1.3.6.2 nathanw #define LINUX_SIGPROF 29
91 1.3.6.2 nathanw #define LINUX_SIGXCPU 30
92 1.3.6.2 nathanw #define LINUX_SIGXFSZ 31
93 1.3.6.2 nathanw
94 1.3.6.6 nathanw /* Min/max real-time linux signal */
95 1.3.6.2 nathanw #define LINUX_SIGRTMIN 32
96 1.3.6.6 nathanw #define LINUX_SIGRTMAX (LINUX__NSIG - 1)
97 1.3.6.2 nathanw
98 1.3.6.2 nathanw #define LINUX__NSIG 128
99 1.3.6.2 nathanw #if defined(ELFSIZE) && (ELFSIZE == 64)
100 1.3.6.2 nathanw #define LINUX__NSIG_BPW 64
101 1.3.6.2 nathanw #else
102 1.3.6.2 nathanw #define LINUX__NSIG_BPW 32
103 1.3.6.2 nathanw #endif
104 1.3.6.2 nathanw #define LINUX__NSIG_WORDS (LINUX__NSIG / LINUX__NSIG_BPW)
105 1.3.6.2 nathanw
106 1.3.6.2 nathanw #define LINUX_SIG_BLOCK 1
107 1.3.6.2 nathanw #define LINUX_SIG_UNBLOCK 2
108 1.3.6.2 nathanw #define LINUX_SIG_SETMASK 3
109 1.3.6.2 nathanw
110 1.3.6.2 nathanw /* sa_flags */
111 1.3.6.2 nathanw #define LINUX_SA_NOCLDSTOP 0x00000001
112 1.3.6.2 nathanw #define LINUX_SA_SIGINFO 0x00000008
113 1.3.6.5 nathanw #define LINUX_SA_NOCLDWAIT 0x00010000
114 1.3.6.5 nathanw #define LINUX_SA_RESTORER 0x04000000
115 1.3.6.2 nathanw #define LINUX_SA_ONSTACK 0x08000000
116 1.3.6.2 nathanw #define LINUX_SA_RESTART 0x10000000
117 1.3.6.2 nathanw #define LINUX_SA_INTERRUPT 0x20000000
118 1.3.6.2 nathanw #define LINUX_SA_NODEFER 0x40000000
119 1.3.6.2 nathanw #define LINUX_SA_RESETHAND 0x80000000
120 1.3.6.2 nathanw #define LINUX_SA_NOMASK LINUX_SA_NODEFER
121 1.3.6.2 nathanw #define LINUX_SA_ONESHOT LINUX_SA_RESETHAND
122 1.3.6.5 nathanw #define LINUX_SA_ALLBITS 0xfc010009 /* XXX from i386, not in mips. */
123 1.3.6.2 nathanw
124 1.3.6.2 nathanw typedef void (*linux___sighandler_t) __P((int));
125 1.3.6.2 nathanw
126 1.3.6.2 nathanw typedef unsigned long linux_old_sigset_t;
127 1.3.6.2 nathanw typedef struct {
128 1.3.6.2 nathanw unsigned long sig[LINUX__NSIG_WORDS];
129 1.3.6.2 nathanw } linux_sigset_t;
130 1.3.6.2 nathanw
131 1.3.6.2 nathanw /* Used in rt_* calls. No old_sigaction is defined for MIPS */
132 1.3.6.2 nathanw struct linux_sigaction {
133 1.3.6.7 thorpej unsigned int linux_sa_flags;
134 1.3.6.7 thorpej linux___sighandler_t linux_sa_handler;
135 1.3.6.7 thorpej linux_sigset_t linux_sa_mask;
136 1.3.6.7 thorpej void (*linux_sa_restorer) __P((void));
137 1.3.6.7 thorpej int linux_sa_resv[1];
138 1.3.6.2 nathanw };
139 1.3.6.2 nathanw
140 1.3.6.2 nathanw struct linux_k_sigaction {
141 1.3.6.2 nathanw struct linux_sigaction sa;
142 1.3.6.2 nathanw };
143 1.3.6.2 nathanw
144 1.3.6.3 nathanw struct linux_old_sigaction {
145 1.3.6.7 thorpej unsigned int linux_sa_flags;
146 1.3.6.7 thorpej linux___sighandler_t linux_sa_handler;
147 1.3.6.7 thorpej linux_old_sigset_t linux_sa_mask;
148 1.3.6.7 thorpej void (*linux_sa_restorer) __P((void));
149 1.3.6.7 thorpej int linux_sa_resv[1];
150 1.3.6.3 nathanw };
151 1.3.6.3 nathanw
152 1.3.6.2 nathanw #define LINUX_SS_ONSTACK 1
153 1.3.6.2 nathanw #define LINUX_SS_DISABLE 2
154 1.3.6.2 nathanw
155 1.3.6.2 nathanw #define LINUX_MINSIGSTKSZ 2048
156 1.3.6.2 nathanw #define LINUX_SIGSTKSZ 8192
157 1.3.6.2 nathanw
158 1.3.6.2 nathanw struct linux_sigaltstack {
159 1.3.6.2 nathanw void *ss_sp;
160 1.3.6.2 nathanw size_t ss_size;
161 1.3.6.2 nathanw int ss_flags;
162 1.3.6.2 nathanw };
163 1.3.6.2 nathanw typedef struct linux_sigaltstack linux_stack_t; /* XXX really needed ? */
164 1.3.6.2 nathanw
165 1.3.6.2 nathanw #endif /* !_MIPS_LINUX_SIGNAL_H */
166