xref: /openbsd-src/sys/arch/amd64/include/signal.h (revision 7730d1d9cb84cef07e5a404bafac47d7e8e531c6)
1*7730d1d9Sderaadt /*	$OpenBSD: signal.h,v 1.9 2016/05/10 18:39:42 deraadt Exp $	*/
2f5df1827Smickey /*	$NetBSD: signal.h,v 1.2 2003/04/28 23:16:17 bjh21 Exp $	*/
3f5df1827Smickey 
4f5df1827Smickey /*
5f5df1827Smickey  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
6f5df1827Smickey  * All rights reserved.
7f5df1827Smickey  *
8f5df1827Smickey  * Redistribution and use in source and binary forms, with or without
9f5df1827Smickey  * modification, are permitted provided that the following conditions
10f5df1827Smickey  * are met:
11f5df1827Smickey  * 1. Redistributions of source code must retain the above copyright
12f5df1827Smickey  *    notice, this list of conditions and the following disclaimer.
13f5df1827Smickey  * 2. Redistributions in binary form must reproduce the above copyright
14f5df1827Smickey  *    notice, this list of conditions and the following disclaimer in the
15f5df1827Smickey  *    documentation and/or other materials provided with the distribution.
16c5217b0aSjsg  * 3. Neither the name of the University nor the names of its contributors
17f5df1827Smickey  *    may be used to endorse or promote products derived from this software
18f5df1827Smickey  *    without specific prior written permission.
19f5df1827Smickey  *
20f5df1827Smickey  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21f5df1827Smickey  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22f5df1827Smickey  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23f5df1827Smickey  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24f5df1827Smickey  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25f5df1827Smickey  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26f5df1827Smickey  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27f5df1827Smickey  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28f5df1827Smickey  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29f5df1827Smickey  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30f5df1827Smickey  * SUCH DAMAGE.
31f5df1827Smickey  *
32f5df1827Smickey  *	@(#)signal.h	7.16 (Berkeley) 3/17/91
33f5df1827Smickey  */
34f5df1827Smickey 
352fa72412Spirofti #ifndef _MACHINE_SIGNAL_H_
362fa72412Spirofti #define _MACHINE_SIGNAL_H_
37f5df1827Smickey 
387c2ef5d9Smillert #include <sys/cdefs.h>
397c2ef5d9Smillert 
40f5df1827Smickey typedef int sig_atomic_t;
41f5df1827Smickey 
4293b1f12aSderaadt #ifdef _KERNEL
43f5df1827Smickey #include <machine/trap.h>
449fa6b648Smillert #endif
45f5df1827Smickey 
469fa6b648Smillert #if __BSD_VISIBLE || __XPG_VISIBLE >= 420
47f5df1827Smickey /*
48f5df1827Smickey  * Information pushed on stack when a signal is delivered.
49f5df1827Smickey  * This is used by the kernel to restore state following
50f5df1827Smickey  * execution of the signal handler.  It is also made available
51f5df1827Smickey  * to the handler to allow it to restore state properly if
52f5df1827Smickey  * a non-standard exit is performed.
53f5df1827Smickey  */
54f5df1827Smickey struct sigcontext {
55f5df1827Smickey 	/* plain match trapframe */
56f5df1827Smickey 	long	sc_rdi;
57f5df1827Smickey 	long	sc_rsi;
58f5df1827Smickey 	long	sc_rdx;
59f5df1827Smickey 	long	sc_rcx;
60f5df1827Smickey 	long	sc_r8;
61f5df1827Smickey 	long	sc_r9;
62f5df1827Smickey 	long	sc_r10;
63f5df1827Smickey 	long	sc_r11;
64f5df1827Smickey 	long	sc_r12;
65f5df1827Smickey 	long	sc_r13;
66f5df1827Smickey 	long	sc_r14;
67f5df1827Smickey 	long	sc_r15;
68f5df1827Smickey 	long	sc_rbp;
69f5df1827Smickey 	long	sc_rbx;
70f5df1827Smickey 	long	sc_rax;
71f5df1827Smickey 	long	sc_gs;
72f5df1827Smickey 	long	sc_fs;
73f5df1827Smickey 	long	sc_es;
74f5df1827Smickey 	long	sc_ds;
75f5df1827Smickey 	long	sc_trapno;
76f5df1827Smickey 	long	sc_err;
77f5df1827Smickey 	long	sc_rip;
78f5df1827Smickey 	long	sc_cs;
79f5df1827Smickey 	long	sc_rflags;
80f5df1827Smickey 	long	sc_rsp;
81f5df1827Smickey 	long	sc_ss;
82f5df1827Smickey 
8366cd01fbSmickey 	struct fxsave64 *sc_fpstate;
841eaa59e7Sguenther 	int	__sc_unused;
85f5df1827Smickey 	int	sc_mask;
86*7730d1d9Sderaadt 	long	sc_cookie;
87f5df1827Smickey };
889fa6b648Smillert #endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */
892fa72412Spirofti #endif	/* !_MACHINE_SIGNAL_H_ */
90