sigframe.h revision 51907
151792Smarcel/*-
251792Smarcel * Copyright (c) 1999 Marcel Moolenaar
351792Smarcel * All rights reserved.
451792Smarcel *
551792Smarcel * Redistribution and use in source and binary forms, with or without
651792Smarcel * modification, are permitted provided that the following conditions
751792Smarcel * are met:
851792Smarcel * 1. Redistributions of source code must retain the above copyright
951792Smarcel *    notice, this list of conditions and the following disclaimer
1051792Smarcel *    in this position and unchanged.
1151792Smarcel * 2. Redistributions in binary form must reproduce the above copyright
1251792Smarcel *    notice, this list of conditions and the following disclaimer in the
1351792Smarcel *    documentation and/or other materials provided with the distribution.
1451792Smarcel * 3. The name of the author may not be used to endorse or promote products
1551792Smarcel *    derived from this software without specific prior written permission.
1651792Smarcel *
1751792Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1851792Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1951792Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2051792Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2151792Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2251792Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2351792Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2451792Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2551792Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2651792Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2751792Smarcel *
2851792Smarcel * $FreeBSD: head/sys/i386/include/sigframe.h 51907 1999-10-03 12:55:58Z marcel $
2951792Smarcel */
3051792Smarcel
3151792Smarcel#ifndef _MACHINE_SIGFRAME_H_
3251907Smarcel#define	_MACHINE_SIGFRAME_H_
3351792Smarcel
3451907Smarcel/*
3551907Smarcel * Signal frames, arguments passed to application signal handlers.
3651907Smarcel */
3751907Smarcel
3851792Smarcelstruct	osigframe {
3951792Smarcel	/*
4051792Smarcel	 * The first three members may be used by applications.
4151792Smarcel	 */
4251792Smarcel
4351792Smarcel	register_t	sf_signum;
4451792Smarcel
4551792Smarcel	/*
4651792Smarcel	 * Either 'int' for old-style FreeBSD handler or 'siginfo_t *'
4751792Smarcel	 * pointing to sf_siginfo for SA_SIGINFO handlers.
4851792Smarcel	 */
4951792Smarcel	register_t	sf_arg2;
5051792Smarcel
5151792Smarcel	/* Points to sf_siginfo.si_sc. */
5251792Smarcel	register_t	sf_scp;
5351792Smarcel
5451792Smarcel	/*
5551792Smarcel	 * The following arguments are not constrained by the
5651792Smarcel	 * function call protocol.
5751792Smarcel	 * Applications are not supposed to access these members,
5851792Smarcel	 * except using the pointers we provide in the first three
5951792Smarcel	 * arguments.
6051792Smarcel	 */
6151792Smarcel
6251792Smarcel	char		*sf_addr;
6351792Smarcel
6451792Smarcel	union {
6551792Smarcel		__osiginfohandler_t	*sf_action;
6651792Smarcel		__sighandler_t		*sf_handler;
6751792Smarcel	} sf_ahu;
6851792Smarcel
6951792Smarcel	/* In the SA_SIGINFO case, sf_arg2 points here. */
7051792Smarcel	osiginfo_t	sf_siginfo;
7151792Smarcel};
7251792Smarcel
7351792Smarcelstruct sigframe {
7451792Smarcel	/*
7551907Smarcel	 * The first four members may be used by applications.
7651907Smarcel	 * NOTE: The 4th argument is undocumented, ill commented
7751907Smarcel	 *       on and seems to be somewhat BSD "standard".
7851907Smarcel	 *       Handlers installed with sigvec may be using it.
7951792Smarcel	 */
8051792Smarcel	register_t	sf_signum;
8151792Smarcel	register_t	sf_siginfo;		/* code or pointer to sf_si */
8251792Smarcel	register_t	sf_ucontext;		/* points to sf_uc */
8351907Smarcel	char		*sf_addr;		/* undocumented 4th arg */
8451907Smarcel
8551792Smarcel	union {
8651792Smarcel		__siginfohandler_t	*sf_action;
8751792Smarcel		__sighandler_t		*sf_handler;
8851792Smarcel	} sf_ahu;
8951792Smarcel	register_t	sf_sigreturn;	/* sigreturn to use */
9051792Smarcel	siginfo_t	sf_si;		/* = *sf_siginfo (SA_SIGINFO case) */
9151792Smarcel	ucontext_t	sf_uc;		/* = *sf_ucontext */
9251792Smarcel};
9351792Smarcel
9451907Smarcel#endif /* !_MACHINE_SIGFRAME_H_ */
95