xref: /dragonfly/sys/cpu/x86_64/include/signal.h (revision 6ab64ab6)
1 /*
2  * Copyright (c) 1986, 1989, 1991, 1993
3  *	The Regents of the University of California.
4  * Copyright (c) 2008 The DragonFly Project.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. Neither the name of the University nor the names of its contributors
16  *    may be used to endorse or promote products derived from this software
17  *    without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29  * SUCH DAMAGE.
30  *
31  *	@(#)signal.h	8.1 (Berkeley) 6/11/93
32  * $FreeBSD: src/sys/i386/include/signal.h,v 1.12 1999/11/12 13:52:11 marcel Exp $
33  */
34 
35 #ifndef _CPU_SIGNAL_H_
36 #define	_CPU_SIGNAL_H_
37 
38 /*
39  * Machine-dependent signal definitions
40  */
41 
42 typedef int sig_atomic_t;
43 
44 #if __BSD_VISIBLE
45 
46 #include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
47 
48 /*
49  * Information pushed on stack when a signal is delivered.
50  * This is used by the kernel to restore state following
51  * execution of the signal handler.  It is also made available
52  * to the handler to allow it to restore state properly if
53  * a non-standard exit is performed.
54  *
55  * The sequence of the fields/registers in struct sigcontext should match
56  * those in mcontext_t.
57  */
58 struct	sigcontext {
59 	sigset_t	sc_mask;	/* signal mask to restore */
60 
61 	long		sc_onstack;	/* sigstack state to restore */
62 	long		sc_rdi;
63 	long		sc_rsi;
64 	long		sc_rdx;
65 	long		sc_rcx;
66 	long		sc_r8;
67 	long		sc_r9;
68 	long		sc_rax;
69 	long		sc_rbx;
70 	long		sc_rbp;
71 	long		sc_r10;
72 	long		sc_r11;
73 	long		sc_r12;
74 	long		sc_r13;
75 	long		sc_r14;
76 	long		sc_r15;
77 	long		sc_xflags;
78 	long		sc_trapno;
79 	long		sc_addr;
80 	long		sc_flags;
81 	long		sc_err;
82 	long		sc_rip;
83 	long		sc_cs;
84 	long		sc_rflags;
85 	long		sc_rsp;
86 	long		sc_ss;
87 
88 	unsigned int	sc_len;
89 	unsigned int	sc_fpformat;
90 	unsigned int	sc_ownedfp;
91 	unsigned int	sc_reserved;
92 	unsigned int    sc_unused[8];
93 
94 	/* 64 byte aligned */
95 	int             sc_fpregs[256]; /* 1024 bytes */
96 } __attribute__((aligned(64)));
97 
98 #endif /* __BSD_VISIBLE */
99 
100 #endif /* !_CPU_SIGNAL_H_ */
101