linux_signo.c revision 1.2 1 1.2 christos /* $NetBSD: linux_signo.c,v 1.2 2002/03/31 22:40:19 christos Exp $ */
2 1.1 christos /*-
3 1.1 christos * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
4 1.1 christos * All rights reserved.
5 1.1 christos *
6 1.1 christos * This code is derived from software contributed to The NetBSD Foundation
7 1.1 christos * by Frank van der Linden and Eric Haszlakiewicz.
8 1.1 christos *
9 1.1 christos * Redistribution and use in source and binary forms, with or without
10 1.1 christos * modification, are permitted provided that the following conditions
11 1.1 christos * are met:
12 1.1 christos * 1. Redistributions of source code must retain the above copyright
13 1.1 christos * notice, this list of conditions and the following disclaimer.
14 1.1 christos * 2. Redistributions in binary form must reproduce the above copyright
15 1.1 christos * notice, this list of conditions and the following disclaimer in the
16 1.1 christos * documentation and/or other materials provided with the distribution.
17 1.1 christos * 3. All advertising materials mentioning features or use of this software
18 1.1 christos * must display the following acknowledgement:
19 1.1 christos * This product includes software developed by the NetBSD
20 1.1 christos * Foundation, Inc. and its contributors.
21 1.1 christos * 4. Neither the name of The NetBSD Foundation nor the names of its
22 1.1 christos * contributors may be used to endorse or promote products derived
23 1.1 christos * from this software without specific prior written permission.
24 1.1 christos *
25 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26 1.1 christos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 1.1 christos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 1.1 christos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29 1.1 christos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 1.1 christos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 1.1 christos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 1.1 christos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 1.1 christos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 1.1 christos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 1.1 christos * POSSIBILITY OF SUCH DAMAGE.
36 1.1 christos */
37 1.1 christos
38 1.1 christos #include <sys/cdefs.h>
39 1.2 christos __KERNEL_RCSID(0, "$NetBSD: linux_signo.c,v 1.2 2002/03/31 22:40:19 christos Exp $");
40 1.1 christos
41 1.1 christos #include <sys/types.h>
42 1.1 christos #include <sys/signal.h>
43 1.1 christos
44 1.1 christos #include <compat/linux/common/linux_types.h>
45 1.1 christos #include <compat/linux/common/linux_signal.h>
46 1.1 christos
47 1.1 christos #ifndef LINUX_SIGINFO
48 1.1 christos #define LINUX_SIGINFO 0
49 1.1 christos #endif
50 1.1 christos
51 1.1 christos #ifndef LINUX_SIGEMT
52 1.1 christos #define LINUX_SIGEMT 0
53 1.1 christos #endif
54 1.1 christos
55 1.1 christos /* Note: linux_to_native_signo[] is in <arch>/linux_sigarray.c */
56 1.1 christos const int native_to_linux_signo[] = {
57 1.1 christos 0, /* 0 */
58 1.1 christos LINUX_SIGHUP, /* 1 */
59 1.1 christos LINUX_SIGINT, /* 2 */
60 1.1 christos LINUX_SIGQUIT, /* 3 */
61 1.1 christos LINUX_SIGILL, /* 4 */
62 1.1 christos LINUX_SIGTRAP, /* 5 */
63 1.1 christos LINUX_SIGABRT, /* 6 */
64 1.1 christos LINUX_SIGEMT, /* 7 */
65 1.1 christos LINUX_SIGFPE, /* 8 */
66 1.1 christos LINUX_SIGKILL, /* 9 */
67 1.1 christos LINUX_SIGBUS, /* 10 */
68 1.1 christos LINUX_SIGSEGV, /* 11 */
69 1.1 christos LINUX_SIGSYS, /* 12 */
70 1.1 christos LINUX_SIGPIPE, /* 13 */
71 1.1 christos LINUX_SIGALRM, /* 14 */
72 1.1 christos LINUX_SIGTERM, /* 15 */
73 1.1 christos LINUX_SIGURG, /* 16 */
74 1.1 christos LINUX_SIGSTOP, /* 17 */
75 1.1 christos LINUX_SIGTSTP, /* 18 */
76 1.1 christos LINUX_SIGCONT, /* 19 */
77 1.1 christos LINUX_SIGCHLD, /* 20 */
78 1.1 christos LINUX_SIGTTIN, /* 21 */
79 1.1 christos LINUX_SIGTTOU, /* 22 */
80 1.1 christos LINUX_SIGIO, /* 23 */
81 1.1 christos LINUX_SIGXCPU, /* 24 */
82 1.1 christos LINUX_SIGXFSZ, /* 25 */
83 1.1 christos LINUX_SIGVTALRM, /* 26 */
84 1.1 christos LINUX_SIGPROF, /* 27 */
85 1.1 christos LINUX_SIGWINCH, /* 28 */
86 1.1 christos LINUX_SIGINFO, /* 29 */
87 1.1 christos LINUX_SIGUSR1, /* 30 */
88 1.1 christos LINUX_SIGUSR2, /* 31 */
89 1.1 christos LINUX_SIGPWR, /* 32 */
90 1.1 christos LINUX_SIGRTMIN + 0, /* 33 */
91 1.1 christos LINUX_SIGRTMIN + 1, /* 34 */
92 1.1 christos LINUX_SIGRTMIN + 2, /* 35 */
93 1.1 christos LINUX_SIGRTMIN + 3, /* 36 */
94 1.1 christos LINUX_SIGRTMIN + 4, /* 37 */
95 1.1 christos LINUX_SIGRTMIN + 5, /* 38 */
96 1.1 christos LINUX_SIGRTMIN + 6, /* 39 */
97 1.1 christos LINUX_SIGRTMIN + 7, /* 40 */
98 1.1 christos LINUX_SIGRTMIN + 8, /* 41 */
99 1.1 christos LINUX_SIGRTMIN + 9, /* 42 */
100 1.1 christos LINUX_SIGRTMIN + 10, /* 43 */
101 1.1 christos LINUX_SIGRTMIN + 11, /* 44 */
102 1.1 christos LINUX_SIGRTMIN + 12, /* 45 */
103 1.1 christos LINUX_SIGRTMIN + 13, /* 46 */
104 1.1 christos LINUX_SIGRTMIN + 14, /* 47 */
105 1.1 christos LINUX_SIGRTMIN + 15, /* 48 */
106 1.1 christos LINUX_SIGRTMIN + 16, /* 49 */
107 1.1 christos LINUX_SIGRTMIN + 17, /* 50 */
108 1.1 christos LINUX_SIGRTMIN + 18, /* 51 */
109 1.1 christos LINUX_SIGRTMIN + 19, /* 52 */
110 1.1 christos LINUX_SIGRTMIN + 20, /* 53 */
111 1.1 christos LINUX_SIGRTMIN + 21, /* 54 */
112 1.1 christos LINUX_SIGRTMIN + 22, /* 55 */
113 1.1 christos LINUX_SIGRTMIN + 23, /* 56 */
114 1.1 christos LINUX_SIGRTMIN + 24, /* 57 */
115 1.1 christos LINUX_SIGRTMIN + 25, /* 58 */
116 1.1 christos LINUX_SIGRTMIN + 26, /* 59 */
117 1.1 christos LINUX_SIGRTMIN + 27, /* 60 */
118 1.1 christos LINUX_SIGRTMIN + 28, /* 61 */
119 1.1 christos LINUX_SIGRTMIN + 29, /* 62 */
120 1.1 christos LINUX_SIGRTMIN + 30, /* 63 */
121 1.1 christos };
122 1.2 christos
123 1.2 christos #if defined(__i386__)
124 1.2 christos #include <compat/linux/arch/i386/linux_sigarray.c>
125 1.2 christos #elif defined(__m68k__)
126 1.2 christos #include <compat/linux/arch/m68k/linux_sigarray.c>
127 1.2 christos #elif defined(__alpha__)
128 1.2 christos #include <compat/linux/arch/alpha/linux_sigarray.c>
129 1.2 christos #elif defined(__powerpc__)
130 1.2 christos #include <compat/linux/arch/powerpc/linux_sigarray.c>
131 1.2 christos #elif defined(__mips__)
132 1.2 christos #include <compat/linux/arch/mips/linux_sigarray.c>
133 1.2 christos #elif defined(__arm__)
134 1.2 christos #include <compat/linux/arch/arm/linux_sigarray.c>
135 1.2 christos #else
136 1.2 christos const int linux_to_native_signo[NSIG];
137 1.2 christos #endif
138