signal.h revision 122278
198527Sfenner/*
244165Sjulian * Copyright (c) 1986, 1989, 1991, 1993
344165Sjulian *	The Regents of the University of California.  All rights reserved.
444165Sjulian *
544165Sjulian * Redistribution and use in source and binary forms, with or without
644165Sjulian * modification, are permitted provided that the following conditions
744165Sjulian * are met:
844165Sjulian * 1. Redistributions of source code must retain the above copyright
944165Sjulian *    notice, this list of conditions and the following disclaimer.
1044165Sjulian * 2. Redistributions in binary form must reproduce the above copyright
1144165Sjulian *    notice, this list of conditions and the following disclaimer in the
1244165Sjulian *    documentation and/or other materials provided with the distribution.
1344165Sjulian * 3. All advertising materials mentioning features or use of this software
1444165Sjulian *    must display the following acknowledgement:
1544165Sjulian *	This product includes software developed by the University of
1644165Sjulian *	California, Berkeley and its contributors.
1744165Sjulian * 4. Neither the name of the University nor the names of its contributors
1844165Sjulian *    may be used to endorse or promote products derived from this software
1944165Sjulian *    without specific prior written permission.
2044165Sjulian *
2144165Sjulian * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2244165Sjulian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2344165Sjulian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2444165Sjulian * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2544165Sjulian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2644165Sjulian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2744165Sjulian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2898527Sfenner * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2944165Sjulian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3044165Sjulian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3198527Sfenner * SUCH DAMAGE.
3298527Sfenner *
3398527Sfenner *	@(#)signal.h	8.1 (Berkeley) 6/11/93
3498527Sfenner * $FreeBSD: head/sys/amd64/include/signal.h 122278 2003-11-08 02:39:46Z peter $
3598527Sfenner */
3698527Sfenner
3744165Sjulian#ifndef _MACHINE_SIGNAL_H_
3898527Sfenner#define	_MACHINE_SIGNAL_H_
3998527Sfenner
4098527Sfenner#include <sys/cdefs.h>
4198527Sfenner#include <sys/_sigset.h>
4298527Sfenner
4398527Sfenner/*
4498527Sfenner * Machine-dependent signal definitions
4550514Slile */
4644165Sjulian
4798527Sfennertypedef long sig_atomic_t;
4898527Sfenner
4998527Sfenner#if __XSI_VISIBLE
5098527Sfenner/*
5198527Sfenner * Minimum signal stack size. The current signal frame
5298527Sfenner * for i386 is 408 bytes large.
5344165Sjulian */
54#define	MINSIGSTKSZ	(512 * 4)
55#endif
56
57#if __BSD_VISIBLE
58#include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
59
60/*
61 * Only the kernel should need these old type definitions.
62 */
63/*
64 * Information pushed on stack when a signal is delivered.
65 * This is used by the kernel to restore state following
66 * execution of the signal handler.  It is also made available
67 * to the handler to allow it to restore state properly if
68 * a non-standard exit is performed.
69 */
70/*
71 * The sequence of the fields/registers in struct sigcontext should match
72 * those in mcontext_t.
73 */
74struct sigcontext {
75	struct __sigset sc_mask;	/* signal mask to restore */
76	long	sc_onstack;		/* sigstack state to restore */
77	long	sc_rdi;		/* machine state (struct trapframe) */
78	long	sc_rsi;
79	long	sc_rdx;
80	long	sc_rcx;
81	long	sc_r8;
82	long	sc_r9;
83	long	sc_rax;
84	long	sc_rbx;
85	long	sc_rbp;
86	long	sc_r10;
87	long	sc_r11;
88	long	sc_r12;
89	long	sc_r13;
90	long	sc_r14;
91	long	sc_r15;
92	long	sc_trapno;
93	long	sc_addr;
94	long	sc_flags;
95	long	sc_err;
96	long	sc_rip;
97	long	sc_cs;
98	long	sc_rflags;
99	long	sc_rsp;
100	long	sc_ss;
101	long	sc_len;			/* sizeof(mcontext_t) */
102	/*
103	 * XXX - See <machine/ucontext.h> and <machine/fpu.h> for
104	 *       the following fields.
105	 */
106	long	sc_fpformat;
107	long	sc_ownedfp;
108	long	sc_fpstate[64] __aligned(16);
109	long	sc_spare[8];
110};
111#endif /* __BSD_VISIBLE */
112
113#endif /* !_MACHINE_SIGNAL_H_ */
114