2 * FreeBSD siginfo related definitions
4 * Copyright (c) 2013 Stacey D. Son
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef TARGET_OS_SIGINFO_H
21 #define TARGET_OS_SIGINFO_H
23 #define TARGET_NSIG 128
24 #define TARGET_NSIG_BPW (sizeof(uint32_t) * 8)
25 #define TARGET_NSIG_WORDS (TARGET_NSIG / TARGET_NSIG_BPW)
27 /* this struct defines a stack used during syscall handling */
28 typedef struct target_sigaltstack
{
35 uint32_t __bits
[TARGET_NSIG_WORDS
];
38 struct target_sigaction
{
39 abi_ulong _sa_handler
;
41 target_sigset_t sa_mask
;
44 typedef union target_sigval
{
51 typedef struct target_siginfo
{
52 int32_t si_signo
; /* signal number */
53 int32_t si_errno
; /* errno association */
54 int32_t si_code
; /* signal code */
55 int32_t si_pid
; /* sending process */
56 int32_t si_uid
; /* sender's ruid */
57 int32_t si_status
; /* exit value */
58 abi_ulong si_addr
; /* faulting instruction */
59 union target_sigval si_value
; /* signal value */
62 int32_t _trapno
; /* machine specific trap code */
75 /* SIGPOLL -- Not really genreated in FreeBSD ??? */
77 int _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
86 * Syscall number for signals delivered as a result of system calls
92 /* Spare for future growth */
100 struct target_sigevent
{
101 abi_int sigev_notify
;
103 target_sigval_t sigev_value
;
108 * The kernel (and thus QEMU) never looks at these;
109 * they're only used as part of the ABI between a
110 * userspace program and libc.
114 abi_ulong _attribute
;
116 abi_ushort _kevent_flags
;
121 #define target_si_signo si_signo
122 #define target_si_code si_code
123 #define target_si_errno si_errno
124 #define target_si_addr si_addr
126 /* SIGILL si_codes */
127 #define TARGET_ILL_ILLOPC (1) /* Illegal opcode. */
128 #define TARGET_ILL_ILLOPN (2) /* Illegal operand. */
129 #define TARGET_ILL_ILLADR (3) /* Illegal addressing mode. */
130 #define TARGET_ILL_ILLTRP (4) /* Illegal trap. */
131 #define TARGET_ILL_PRVOPC (5) /* Privileged opcode. */
132 #define TARGET_ILL_PRVREG (6) /* Privileged register. */
133 #define TARGET_ILL_COPROC (7) /* Coprocessor error. */
134 #define TARGET_ILL_BADSTK (8) /* Internal stack error. */
136 /* SIGSEGV si_codes */
137 #define TARGET_SEGV_MAPERR (1) /* address not mapped to object */
138 #define TARGET_SEGV_ACCERR (2) /* invalid permissions for mapped object */
140 /* SIGTRAP si_codes */
141 #define TARGET_TRAP_BRKPT (1) /* process beakpoint */
142 #define TARGET_TRAP_TRACE (2) /* process trace trap */
144 /* SIGBUS si_codes */
145 #define TARGET_BUS_ADRALN (1)
146 #define TARGET_BUS_ADRERR (2)
147 #define TARGET_BUS_OBJERR (3)
150 #define TARGET_FPE_INTOVF (1) /* Integer overflow. */
151 #define TARGET_FPE_INTDIV (2) /* Integer divide by zero. */
152 #define TARGET_FPE_FLTDIV (3) /* Floating point divide by zero. */
153 #define TARGET_FPE_FLTOVF (4) /* Floating point overflow. */
154 #define TARGET_FPE_FLTUND (5) /* Floating point underflow. */
155 #define TARGET_FPE_FLTRES (6) /* Floating point inexact result. */
156 #define TARGET_FPE_FLTINV (7) /* Invalid floating point operation. */
157 #define TARGET_FPE_FLTSUB (8) /* Subscript out of range. */
159 #endif /* TARGET_OS_SIGINFO_H */