xref: /freebsd/sys/x86/include/sigframe.h (revision 31a53cd03625e31cbbf63b78cf3c9b711301869a)
1*31a53cd0SKonstantin Belousov /*-
2*31a53cd0SKonstantin Belousov  * Copyright (c) 1999 Marcel Moolenaar
3*31a53cd0SKonstantin Belousov  * All rights reserved.
4*31a53cd0SKonstantin Belousov  *
5*31a53cd0SKonstantin Belousov  * Redistribution and use in source and binary forms, with or without
6*31a53cd0SKonstantin Belousov  * modification, are permitted provided that the following conditions
7*31a53cd0SKonstantin Belousov  * are met:
8*31a53cd0SKonstantin Belousov  * 1. Redistributions of source code must retain the above copyright
9*31a53cd0SKonstantin Belousov  *    notice, this list of conditions and the following disclaimer
10*31a53cd0SKonstantin Belousov  *    in this position and unchanged.
11*31a53cd0SKonstantin Belousov  * 2. Redistributions in binary form must reproduce the above copyright
12*31a53cd0SKonstantin Belousov  *    notice, this list of conditions and the following disclaimer in the
13*31a53cd0SKonstantin Belousov  *    documentation and/or other materials provided with the distribution.
14*31a53cd0SKonstantin Belousov  * 3. The name of the author may not be used to endorse or promote products
15*31a53cd0SKonstantin Belousov  *    derived from this software without specific prior written permission.
16*31a53cd0SKonstantin Belousov  *
17*31a53cd0SKonstantin Belousov  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18*31a53cd0SKonstantin Belousov  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19*31a53cd0SKonstantin Belousov  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20*31a53cd0SKonstantin Belousov  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21*31a53cd0SKonstantin Belousov  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22*31a53cd0SKonstantin Belousov  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23*31a53cd0SKonstantin Belousov  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24*31a53cd0SKonstantin Belousov  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25*31a53cd0SKonstantin Belousov  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26*31a53cd0SKonstantin Belousov  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*31a53cd0SKonstantin Belousov  *
28*31a53cd0SKonstantin Belousov  * $FreeBSD$
29*31a53cd0SKonstantin Belousov  */
30*31a53cd0SKonstantin Belousov 
31*31a53cd0SKonstantin Belousov #ifndef _X86_SIGFRAME_H_
32*31a53cd0SKonstantin Belousov #define	_X86_SIGFRAME_H_
33*31a53cd0SKonstantin Belousov 
34*31a53cd0SKonstantin Belousov /*
35*31a53cd0SKonstantin Belousov  * Signal frames, arguments passed to application signal handlers.
36*31a53cd0SKonstantin Belousov  */
37*31a53cd0SKonstantin Belousov 
38*31a53cd0SKonstantin Belousov #ifdef __i386__
39*31a53cd0SKonstantin Belousov struct sigframe {
40*31a53cd0SKonstantin Belousov 	/*
41*31a53cd0SKonstantin Belousov 	 * The first four members may be used by applications.
42*31a53cd0SKonstantin Belousov 	 *
43*31a53cd0SKonstantin Belousov 	 * NOTE: The 4th argument is undocumented, ill commented
44*31a53cd0SKonstantin Belousov 	 * on and seems to be somewhat BSD "standard".  Handlers
45*31a53cd0SKonstantin Belousov 	 * installed with sigvec may be using it.
46*31a53cd0SKonstantin Belousov 	 */
47*31a53cd0SKonstantin Belousov 	register_t	sf_signum;
48*31a53cd0SKonstantin Belousov 	register_t	sf_siginfo;	/* code or pointer to sf_si */
49*31a53cd0SKonstantin Belousov 	register_t	sf_ucontext;	/* points to sf_uc */
50*31a53cd0SKonstantin Belousov 	register_t	sf_addr;	/* undocumented 4th arg */
51*31a53cd0SKonstantin Belousov 
52*31a53cd0SKonstantin Belousov 	union {
53*31a53cd0SKonstantin Belousov 		__siginfohandler_t	*sf_action;
54*31a53cd0SKonstantin Belousov 		__sighandler_t		*sf_handler;
55*31a53cd0SKonstantin Belousov 	} sf_ahu;
56*31a53cd0SKonstantin Belousov 	ucontext_t	sf_uc;		/* = *sf_ucontext */
57*31a53cd0SKonstantin Belousov 	siginfo_t	sf_si;		/* = *sf_siginfo (SA_SIGINFO case) */
58*31a53cd0SKonstantin Belousov };
59*31a53cd0SKonstantin Belousov #endif /* __i386__ */
60*31a53cd0SKonstantin Belousov 
61*31a53cd0SKonstantin Belousov #ifdef __amd64__
62*31a53cd0SKonstantin Belousov struct sigframe {
63*31a53cd0SKonstantin Belousov 	union {
64*31a53cd0SKonstantin Belousov 		__siginfohandler_t	*sf_action;
65*31a53cd0SKonstantin Belousov 		__sighandler_t		*sf_handler;
66*31a53cd0SKonstantin Belousov 	} sf_ahu;
67*31a53cd0SKonstantin Belousov 	ucontext_t	sf_uc;		/* = *sf_ucontext */
68*31a53cd0SKonstantin Belousov 	siginfo_t	sf_si;		/* = *sf_siginfo (SA_SIGINFO case) */
69*31a53cd0SKonstantin Belousov };
70*31a53cd0SKonstantin Belousov #endif /* __amd64__ */
71*31a53cd0SKonstantin Belousov 
72*31a53cd0SKonstantin Belousov #endif /* _X86_SIGFRAME_H_ */
73