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: releng/10.3/sys/x86/include/sigframe.h 247047 2013-02-20 17:39:52Z kib $
2951792Smarcel */
3051792Smarcel
31247047Skib#ifndef _X86_SIGFRAME_H_
32247047Skib#define	_X86_SIGFRAME_H_
3351792Smarcel
3451907Smarcel/*
3551907Smarcel * Signal frames, arguments passed to application signal handlers.
3651907Smarcel */
37247047Skib
38247047Skib#ifdef __i386__
3951792Smarcelstruct sigframe {
40247047Skib	/*
41247047Skib	 * The first four members may be used by applications.
42247047Skib	 *
43247047Skib	 * NOTE: The 4th argument is undocumented, ill commented
44247047Skib	 * on and seems to be somewhat BSD "standard".  Handlers
45247047Skib	 * installed with sigvec may be using it.
46247047Skib	 */
47247047Skib	register_t	sf_signum;
48247047Skib	register_t	sf_siginfo;	/* code or pointer to sf_si */
49247047Skib	register_t	sf_ucontext;	/* points to sf_uc */
50247047Skib	register_t	sf_addr;	/* undocumented 4th arg */
51247047Skib
5251792Smarcel	union {
5351792Smarcel		__siginfohandler_t	*sf_action;
5451792Smarcel		__sighandler_t		*sf_handler;
5551792Smarcel	} sf_ahu;
5651984Smarcel	ucontext_t	sf_uc;		/* = *sf_ucontext */
5751792Smarcel	siginfo_t	sf_si;		/* = *sf_siginfo (SA_SIGINFO case) */
5851792Smarcel};
59247047Skib#endif /* __i386__ */
6051792Smarcel
61247047Skib#ifdef __amd64__
62247047Skibstruct sigframe {
63247047Skib	union {
64247047Skib		__siginfohandler_t	*sf_action;
65247047Skib		__sighandler_t		*sf_handler;
66247047Skib	} sf_ahu;
67247047Skib	ucontext_t	sf_uc;		/* = *sf_ucontext */
68247047Skib	siginfo_t	sf_si;		/* = *sf_siginfo (SA_SIGINFO case) */
69247047Skib};
70247047Skib#endif /* __amd64__ */
71247047Skib
72247047Skib#endif /* _X86_SIGFRAME_H_ */
73