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/>.
19 #ifndef _TARGET_OS_SIGINFO_H_
20 #define _TARGET_OS_SIGINFO_H_
22 #define TARGET_NSIG 128
23 #define TARGET_NSIG_BPW (sizeof(uint32_t) * 8)
24 #define TARGET_NSIG_WORDS (TARGET_NSIG / TARGET_NSIG_BPW)
26 /* this struct defines a stack used during syscall handling */
27 typedef struct target_sigaltstack
{
34 uint32_t __bits
[TARGET_NSIG_WORDS
];
37 struct target_sigaction
{
38 abi_ulong _sa_handler
;
40 target_sigset_t sa_mask
;
43 typedef union target_sigval
{
50 typedef struct target_siginfo
{
51 int32_t si_signo
; /* signal number */
52 int32_t si_errno
; /* errno association */
53 int32_t si_code
; /* signal code */
54 int32_t si_pid
; /* sending process */
55 int32_t si_uid
; /* sender's ruid */
56 int32_t si_status
; /* exit value */
57 abi_ulong si_addr
; /* faulting instruction */
58 union target_sigval si_value
; /* signal value */
61 int32_t _trapno
; /* machine specific trap code */
74 /* SIGPOLL -- Not really genreated in FreeBSD ??? */
76 int _band
; /* POLL_IN, POLL_OUT, POLL_MSG */
85 * Syscall number for signals delivered as a result of system calls
91 /* Spare for future growth */
99 struct target_sigevent
{
100 abi_int sigev_notify
;
102 target_sigval_t sigev_value
;
107 * The kernel (and thus QEMU) never looks at these;
108 * they're only used as part of the ABI between a
109 * userspace program and libc.
113 abi_ulong _attribute
;
115 abi_ushort _kevent_flags
;
120 #define target_si_signo si_signo
121 #define target_si_code si_code
122 #define target_si_errno si_errno
123 #define target_si_addr si_addr
125 /* SIGILL si_codes */
126 #define TARGET_ILL_ILLOPC (1) /* Illegal opcode. */
127 #define TARGET_ILL_ILLOPN (2) /* Illegal operand. */
128 #define TARGET_ILL_ILLADR (3) /* Illegal addressing mode. */
129 #define TARGET_ILL_ILLTRP (4) /* Illegal trap. */
130 #define TARGET_ILL_PRVOPC (5) /* Privileged opcode. */
131 #define TARGET_ILL_PRVREG (6) /* Privileged register. */
132 #define TARGET_ILL_COPROC (7) /* Coprocessor error. */
133 #define TARGET_ILL_BADSTK (8) /* Internal stack error. */
135 /* SIGSEGV si_codes */
136 #define TARGET_SEGV_MAPERR (1) /* address not mapped to object */
137 #define TARGET_SEGV_ACCERR (2) /* invalid permissions for mapped object */
139 /* SIGTRAP si_codes */
140 #define TARGET_TRAP_BRKPT (1) /* process beakpoint */
141 #define TARGET_TRAP_TRACE (2) /* process trace trap */
143 /* SIGBUS si_codes */
144 #define TARGET_BUS_ADRALN (1)
145 #define TARGET_BUS_ADRERR (2)
146 #define TARGET_BUS_OBJERR (3)
149 #define TARGET_FPE_INTOVF (1) /* Integer overflow. */
150 #define TARGET_FPE_INTDIV (2) /* Integer divide by zero. */
151 #define TARGET_FPE_FLTDIV (3) /* Floating point divide by zero. */
152 #define TARGET_FPE_FLTOVF (4) /* Floating point overflow. */
153 #define TARGET_FPE_FLTUND (5) /* Floating point underflow. */
154 #define TARGET_FPE_FLTRES (6) /* Floating point inexact result. */
155 #define TARGET_FPE_FLTINV (7) /* Invalid floating point operation. */
156 #define TARGET_FPE_FLTSUB (8) /* Subscript out of range. */
158 #endif /* !_TARGET_OS_SIGINFO_H_ */