linux_signal.h revision 1.3.6.4 1 1.3.6.4 nathanw /* $NetBSD: linux_signal.h,v 1.3.6.4 2001/10/22 20:41:13 nathanw 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.2 nathanw #define LINUX_SIGRTMIN 32
95 1.3.6.2 nathanw
96 1.3.6.2 nathanw #define LINUX__NSIG 128
97 1.3.6.2 nathanw #if defined(ELFSIZE) && (ELFSIZE == 64)
98 1.3.6.2 nathanw #define LINUX__NSIG_BPW 64
99 1.3.6.2 nathanw #else
100 1.3.6.2 nathanw #define LINUX__NSIG_BPW 32
101 1.3.6.2 nathanw #endif
102 1.3.6.2 nathanw #define LINUX__NSIG_WORDS (LINUX__NSIG / LINUX__NSIG_BPW)
103 1.3.6.2 nathanw
104 1.3.6.2 nathanw #define LINUX_SIG_BLOCK 1
105 1.3.6.2 nathanw #define LINUX_SIG_UNBLOCK 2
106 1.3.6.2 nathanw #define LINUX_SIG_SETMASK 3
107 1.3.6.2 nathanw
108 1.3.6.2 nathanw /* sa_flags */
109 1.3.6.2 nathanw #define LINUX_SA_NOCLDSTOP 0x00000001
110 1.3.6.2 nathanw #define LINUX_SA_SIGINFO 0x00000008
111 1.3.6.2 nathanw #define LINUX_SA_ONSTACK 0x08000000
112 1.3.6.2 nathanw #define LINUX_SA_RESTART 0x10000000
113 1.3.6.2 nathanw #define LINUX_SA_INTERRUPT 0x20000000
114 1.3.6.2 nathanw #define LINUX_SA_NODEFER 0x40000000
115 1.3.6.2 nathanw #define LINUX_SA_RESETHAND 0x80000000
116 1.3.6.2 nathanw #define LINUX_SA_NOMASK LINUX_SA_NODEFER
117 1.3.6.2 nathanw #define LINUX_SA_ONESHOT LINUX_SA_RESETHAND
118 1.3.6.2 nathanw #define LINUX_SA_ALLBITS 0xf8000001 /* XXX from i386, not in mips. */
119 1.3.6.2 nathanw
120 1.3.6.2 nathanw typedef void (*linux___sighandler_t) __P((int));
121 1.3.6.2 nathanw
122 1.3.6.2 nathanw typedef unsigned long linux_old_sigset_t;
123 1.3.6.2 nathanw typedef struct {
124 1.3.6.2 nathanw unsigned long sig[LINUX__NSIG_WORDS];
125 1.3.6.2 nathanw } linux_sigset_t;
126 1.3.6.2 nathanw
127 1.3.6.2 nathanw /* Used in rt_* calls. No old_sigaction is defined for MIPS */
128 1.3.6.2 nathanw struct linux_sigaction {
129 1.3.6.2 nathanw unsigned int sa_flags;
130 1.3.6.2 nathanw linux___sighandler_t sa_handler;
131 1.3.6.2 nathanw linux_sigset_t sa_mask;
132 1.3.6.2 nathanw void (*sa_restorer) __P((void));
133 1.3.6.2 nathanw int sa_resv[1];
134 1.3.6.2 nathanw };
135 1.3.6.2 nathanw
136 1.3.6.2 nathanw struct linux_k_sigaction {
137 1.3.6.2 nathanw struct linux_sigaction sa;
138 1.3.6.2 nathanw };
139 1.3.6.2 nathanw
140 1.3.6.3 nathanw struct linux_old_sigaction {
141 1.3.6.3 nathanw unsigned int sa_flags;
142 1.3.6.3 nathanw linux___sighandler_t sa_handler;
143 1.3.6.3 nathanw linux_old_sigset_t sa_mask;
144 1.3.6.3 nathanw void (*sa_restorer) __P((void));
145 1.3.6.3 nathanw int sa_resv[1];
146 1.3.6.3 nathanw };
147 1.3.6.3 nathanw
148 1.3.6.2 nathanw #define LINUX_SS_ONSTACK 1
149 1.3.6.2 nathanw #define LINUX_SS_DISABLE 2
150 1.3.6.2 nathanw
151 1.3.6.2 nathanw #define LINUX_MINSIGSTKSZ 2048
152 1.3.6.2 nathanw #define LINUX_SIGSTKSZ 8192
153 1.3.6.2 nathanw
154 1.3.6.2 nathanw struct linux_sigaltstack {
155 1.3.6.2 nathanw void *ss_sp;
156 1.3.6.2 nathanw size_t ss_size;
157 1.3.6.2 nathanw int ss_flags;
158 1.3.6.2 nathanw };
159 1.3.6.2 nathanw typedef struct linux_sigaltstack linux_stack_t; /* XXX really needed ? */
160 1.3.6.2 nathanw
161 1.3.6.2 nathanw #endif /* !_MIPS_LINUX_SIGNAL_H */
162