linux32_siginfo.h revision 1.1 1 1.1 christos /* $NetBSD: linux32_siginfo.h,v 1.1 2011/11/18 04:08:56 christos Exp $ */
2 1.1 christos
3 1.1 christos /*-
4 1.1 christos * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 1.1 christos * All rights reserved.
6 1.1 christos *
7 1.1 christos * This code is derived from software contributed to The NetBSD Foundation
8 1.1 christos * by Eric Haszlakiewicz.
9 1.1 christos *
10 1.1 christos * Redistribution and use in source and binary forms, with or without
11 1.1 christos * modification, are permitted provided that the following conditions
12 1.1 christos * are met:
13 1.1 christos * 1. Redistributions of source code must retain the above copyright
14 1.1 christos * notice, this list of conditions and the following disclaimer.
15 1.1 christos * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 christos * notice, this list of conditions and the following disclaimer in the
17 1.1 christos * documentation and/or other materials provided with the distribution.
18 1.1 christos *
19 1.1 christos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 1.1 christos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 1.1 christos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 1.1 christos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 1.1 christos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 1.1 christos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 1.1 christos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 1.1 christos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 1.1 christos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 1.1 christos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 1.1 christos * POSSIBILITY OF SUCH DAMAGE.
30 1.1 christos */
31 1.1 christos
32 1.1 christos #ifndef _LINUX32_SIGINFO_H
33 1.1 christos #define _LINUX32_SIGINFO_H
34 1.1 christos
35 1.1 christos #if defined(__amd64__)
36 1.1 christos #include <compat/linux32/arch/amd64/linux32_siginfo.h>
37 1.1 christos #endif
38 1.1 christos
39 1.1 christos /* si_code values for non signal */
40 1.1 christos #define LINUX32_SI_USER 0
41 1.1 christos #define LINUX32_SI_KERNEL 0x80
42 1.1 christos #define LINUX32_SI_QUEUE -1
43 1.1 christos #ifndef LINUX32_SI_TIMER /* all except mips */
44 1.1 christos #define LINUX32_SI_TIMER -2
45 1.1 christos #define LINUX32_SI_MESGQ -3
46 1.1 christos #define LINUX32_SI_ASYNCIO -4
47 1.1 christos #endif /* LINUX32_SI_TIMER */
48 1.1 christos #define LINUX32_SI_SIGIO -5
49 1.1 christos #define LINUX32_SI_TKILL -6
50 1.1 christos #define LINUX32_SI_DETHREAD -7
51 1.1 christos
52 1.1 christos /* si_code values for SIGILL */
53 1.1 christos #define LINUX32_ILL_ILLOPC 1
54 1.1 christos #define LINUX32_ILL_ILLOPN 2
55 1.1 christos #define LINUX32_ILL_ILLADR 3
56 1.1 christos #define LINUX32_ILL_ILLTRP 4
57 1.1 christos #define LINUX32_ILL_PRVOPC 5
58 1.1 christos #define LINUX32_ILL_PRVREG 6
59 1.1 christos #define LINUX32_ILL_COPROC 7
60 1.1 christos #define LINUX32_ILL_BADSTK 8
61 1.1 christos
62 1.1 christos /* si_code values for SIGFPE */
63 1.1 christos #define LINUX32_FPE_INTDIV 1
64 1.1 christos #define LINUX32_FPE_INTOVF 2
65 1.1 christos #define LINUX32_FPE_FLTDIV 3
66 1.1 christos #define LINUX32_FPE_FLTOVF 4
67 1.1 christos #define LINUX32_FPE_FLTUND 5
68 1.1 christos #define LINUX32_FPE_FLTRES 6
69 1.1 christos #define LINUX32_FPE_FLTINV 7
70 1.1 christos #define LINUX32_FPE_FLTSUB 8
71 1.1 christos
72 1.1 christos /* si_code values for SIGSEGV */
73 1.1 christos #define LINUX32_SEGV_MAPERR 1
74 1.1 christos #define LINUX32_SEGV_ACCERR 2
75 1.1 christos
76 1.1 christos /* si_code values for SIGBUS */
77 1.1 christos #define LINUX32_BUS_ADRALN 1
78 1.1 christos #define LINUX32_BUS_ADRERR 2
79 1.1 christos #define LINUX32_BUS_OBJERR 3
80 1.1 christos
81 1.1 christos /* si_code values for SIGTRAP */
82 1.1 christos #define LINUX32_TRAP_BRKPT 1
83 1.1 christos #define LINUX32_TRAP_TRACE 2
84 1.1 christos
85 1.1 christos /* si_code values for SIGCHLD */
86 1.1 christos #define LINUX32_CLD_EXITED 1
87 1.1 christos #define LINUX32_CLD_KILLED 2
88 1.1 christos #define LINUX32_CLD_DUMPED 3
89 1.1 christos #define LINUX32_CLD_TRAPPED 4
90 1.1 christos #define LINUX32_CLD_STOPPED 5
91 1.1 christos #define LINUX32_CLD_CONTINUED 6
92 1.1 christos
93 1.1 christos /* si_code values for SIGPOLL */
94 1.1 christos #define LINUX32_POLL_IN 1
95 1.1 christos #define LINUX32_POLL_OUT 2
96 1.1 christos #define LINUX32_POLL_MSG 3
97 1.1 christos #define LINUX32_POLL_ERR 4
98 1.1 christos #define LINUX32_POLL_PRI 5
99 1.1 christos #define LINUX32_POLL_HUP 6
100 1.1 christos
101 1.1 christos #define LINUX32_SI_FROMUSER(sp) ((sp)->si_code <= 0)
102 1.1 christos #define LINUX32_SI_FROMKERNEL(sp) ((sp)->si_code > 0)
103 1.1 christos
104 1.1 christos #define lsi_pid _sidata._kill._pid
105 1.1 christos #define lsi_uid _sidata._kill._uid
106 1.1 christos #define lsi_status _sidata._sigchld._status
107 1.1 christos #define lsi_utime _sidata._sigchld._utime
108 1.1 christos #define lsi_stime _sidata._sigchld._stime
109 1.1 christos #define lsi_value _sidata._rt._sigval
110 1.1 christos #define lsi_sival_int _sidata._rt._sigval.sival_int
111 1.1 christos #define lsi_sival_ptr _sidata._rt._sigval.sival_ptr
112 1.1 christos #define lsi_addr _sidata._sigfault._addr
113 1.1 christos #define lsi_band _sidata._sigpoll._band
114 1.1 christos #define lsi_fd _sidata._sigpoll._fd
115 1.1 christos
116 1.1 christos void native_to_linux32_siginfo(linux32_siginfo_t *, const struct _ksiginfo *);
117 1.1 christos
118 1.1 christos #endif /* !_LINUX32_SIGINFO_H */
119