1 /* $NetBSD: signal.h,v 1.13 2014/01/29 00:42:15 matt Exp $ */
4 * Copyright (c) 1994-1996 Mark Brinicombe.
5 * Copyright (c) 1994 Brini.
8 * This code is derived from software written for Brini by Mark Brinicombe
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Brini.
21 * 4. The name of the company nor the name of the author may be used to
22 * endorse or promote products derived from this software without specific
23 * prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
26 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
29 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * RiscBSD kernel project
41 * Architecture dependent signal types and structures
46 #ifndef _ARM_SIGNAL_H_
47 #define _ARM_SIGNAL_H_
49 #include <sys/featuretest.h>
52 typedef int sig_atomic_t;
55 #if defined(_NETBSD_SOURCE)
59 * Information pushed on stack when a signal is delivered.
60 * This is used by the kernel to restore state following
61 * execution of the signal handler. It is also made available
62 * to the handler to allow it to restore state properly if
63 * a non-standard exit is performed.
66 #if defined(__LIBC12_SOURCE__) || defined(_KERNEL)
68 int sc_onstack
; /* sigstack state to restore */
69 int sc_mask
; /* signal mask to restore (old style) */
85 unsigned int sc_usr_sp
;
86 unsigned int sc_usr_lr
;
87 unsigned int sc_svc_lr
;
90 #endif /* __LIBC12_SOURCE__ || _KERNEL */
93 int sc_onstack
; /* sigstack state to restore */
94 int __sc_mask13
; /* signal mask to restore (old style) */
110 unsigned int sc_usr_sp
;
111 unsigned int sc_usr_lr
;
112 unsigned int sc_svc_lr
;
115 sigset_t sc_mask
; /* signal mask to restore (new style) */
117 #define SC_MAGIC 0xc0ffee2
124 #endif /* !_LOCORE */
131 * see ieeefp.h for definition of FP exception codes
134 #define SIG_CODE_FPE_CODE_MASK 0x00000f00 /* Mask for exception code */
135 #define SIG_CODE_FPE_CODE_SHIFT 8 /* Shift for exception code */
136 #define SIG_CODE_FPE_TYPE_MASK 0x000000ff /* Mask for specific code */
141 * the signal code is the instruction that raised the signal
145 * SIGBUS and SIGSEGV codes
147 * The signal code is combination of the fault address and the fault code.
149 * The fault code is the coproc #15 fault status code
151 * The exception to this is a SIGBUS or SIGSEGV from a prefetch abort.
152 * In this case the fault status code is not valid so the TYPE_MASK
153 * should be treated as undefined (in practice it is the bottom 4 bits
154 * of the fault address).
157 #define SIG_CODE_BUS_ADDR_MASK 0xfffffff0
158 #define SIG_CODE_BUS_TYPE_MASK 0x0000000f
159 #define SIG_CODE_SEGV_ADDR_MASK SIG_CODE_BUS_ADDR_MASK
160 #define SIG_CODE_SEGV_TYPE_MASK SIG_CODE_BUS_TYPE_MASK
162 #endif /* _NETBSD_SOURCE */
166 int sigreturn(struct sigcontext
*_scp
);
168 #endif /* defined(__minix) */
170 #endif /* !_ARM_SIGNAL_H_ */
172 /* End of signal.h */