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