xref: /freebsd/sys/i386/include/sigframe.h (revision 0270d57aef325fb8d49f29133fa43fee1742240c)
191078fcaSMarcel Moolenaar /*-
291078fcaSMarcel Moolenaar  * Copyright (c) 1999 Marcel Moolenaar
391078fcaSMarcel Moolenaar  * All rights reserved.
491078fcaSMarcel Moolenaar  *
591078fcaSMarcel Moolenaar  * Redistribution and use in source and binary forms, with or without
691078fcaSMarcel Moolenaar  * modification, are permitted provided that the following conditions
791078fcaSMarcel Moolenaar  * are met:
891078fcaSMarcel Moolenaar  * 1. Redistributions of source code must retain the above copyright
991078fcaSMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer
1091078fcaSMarcel Moolenaar  *    in this position and unchanged.
1191078fcaSMarcel Moolenaar  * 2. Redistributions in binary form must reproduce the above copyright
1291078fcaSMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer in the
1391078fcaSMarcel Moolenaar  *    documentation and/or other materials provided with the distribution.
1491078fcaSMarcel Moolenaar  * 3. The name of the author may not be used to endorse or promote products
1591078fcaSMarcel Moolenaar  *    derived from this software without specific prior written permission.
1691078fcaSMarcel Moolenaar  *
1791078fcaSMarcel Moolenaar  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1891078fcaSMarcel Moolenaar  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1991078fcaSMarcel Moolenaar  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2091078fcaSMarcel Moolenaar  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2191078fcaSMarcel Moolenaar  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2291078fcaSMarcel Moolenaar  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2391078fcaSMarcel Moolenaar  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2491078fcaSMarcel Moolenaar  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2591078fcaSMarcel Moolenaar  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2691078fcaSMarcel Moolenaar  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2791078fcaSMarcel Moolenaar  *
2891078fcaSMarcel Moolenaar  * $FreeBSD$
2991078fcaSMarcel Moolenaar  */
3091078fcaSMarcel Moolenaar 
3191078fcaSMarcel Moolenaar #ifndef _MACHINE_SIGFRAME_H_
320afa439dSMarcel Moolenaar #define	_MACHINE_SIGFRAME_H_
330afa439dSMarcel Moolenaar 
340afa439dSMarcel Moolenaar /*
350afa439dSMarcel Moolenaar  * Signal frames, arguments passed to application signal handlers.
360afa439dSMarcel Moolenaar  */
370270d57aSDaniel Eischen #ifdef _KERNEL
3891078fcaSMarcel Moolenaar struct osigframe {
3991078fcaSMarcel Moolenaar 	/*
404c53edc5SMarcel Moolenaar 	 * The first four members may be used by applications.
4191078fcaSMarcel Moolenaar 	 */
4291078fcaSMarcel Moolenaar 
4391078fcaSMarcel Moolenaar 	register_t	sf_signum;
4491078fcaSMarcel Moolenaar 
4591078fcaSMarcel Moolenaar 	/*
4691078fcaSMarcel Moolenaar 	 * Either 'int' for old-style FreeBSD handler or 'siginfo_t *'
4791078fcaSMarcel Moolenaar 	 * pointing to sf_siginfo for SA_SIGINFO handlers.
4891078fcaSMarcel Moolenaar 	 */
4991078fcaSMarcel Moolenaar 	register_t	sf_arg2;
5091078fcaSMarcel Moolenaar 
5191078fcaSMarcel Moolenaar 	/* Points to sf_siginfo.si_sc. */
5291078fcaSMarcel Moolenaar 	register_t	sf_scp;
5391078fcaSMarcel Moolenaar 
54ec1d9fe8SMarcel Moolenaar 	register_t	sf_addr;
554c53edc5SMarcel Moolenaar 
5691078fcaSMarcel Moolenaar 	/*
5791078fcaSMarcel Moolenaar 	 * The following arguments are not constrained by the
5891078fcaSMarcel Moolenaar 	 * function call protocol.
5991078fcaSMarcel Moolenaar 	 * Applications are not supposed to access these members,
6091078fcaSMarcel Moolenaar 	 * except using the pointers we provide in the first three
6191078fcaSMarcel Moolenaar 	 * arguments.
6291078fcaSMarcel Moolenaar 	 */
6391078fcaSMarcel Moolenaar 
6491078fcaSMarcel Moolenaar 	union {
6591078fcaSMarcel Moolenaar 		__osiginfohandler_t	*sf_action;
6691078fcaSMarcel Moolenaar 		__sighandler_t		*sf_handler;
6791078fcaSMarcel Moolenaar 	} sf_ahu;
6891078fcaSMarcel Moolenaar 
6991078fcaSMarcel Moolenaar 	/* In the SA_SIGINFO case, sf_arg2 points here. */
7091078fcaSMarcel Moolenaar 	osiginfo_t	sf_siginfo;
7191078fcaSMarcel Moolenaar };
720270d57aSDaniel Eischen #endif
7391078fcaSMarcel Moolenaar 
7491078fcaSMarcel Moolenaar struct sigframe {
7591078fcaSMarcel Moolenaar 	/*
760afa439dSMarcel Moolenaar 	 * The first four members may be used by applications.
774c53edc5SMarcel Moolenaar 	 *
780afa439dSMarcel Moolenaar 	 * NOTE: The 4th argument is undocumented, ill commented
794c53edc5SMarcel Moolenaar 	 * on and seems to be somewhat BSD "standard".  Handlers
804c53edc5SMarcel Moolenaar 	 * installed with sigvec may be using it.
8191078fcaSMarcel Moolenaar 	 */
8291078fcaSMarcel Moolenaar 	register_t	sf_signum;
8391078fcaSMarcel Moolenaar 	register_t	sf_siginfo;	/* code or pointer to sf_si */
8491078fcaSMarcel Moolenaar 	register_t	sf_ucontext;	/* points to sf_uc */
85ec1d9fe8SMarcel Moolenaar 	register_t	sf_addr;	/* undocumented 4th arg */
860afa439dSMarcel Moolenaar 
8791078fcaSMarcel Moolenaar 	union {
8891078fcaSMarcel Moolenaar 		__siginfohandler_t	*sf_action;
8991078fcaSMarcel Moolenaar 		__sighandler_t		*sf_handler;
9091078fcaSMarcel Moolenaar 	} sf_ahu;
9191078fcaSMarcel Moolenaar 	ucontext_t	sf_uc;		/* = *sf_ucontext */
92210430fdSMarcel Moolenaar 	siginfo_t	sf_si;		/* = *sf_siginfo (SA_SIGINFO case) */
9391078fcaSMarcel Moolenaar };
9491078fcaSMarcel Moolenaar 
950afa439dSMarcel Moolenaar #endif /* !_MACHINE_SIGFRAME_H_ */
96