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$
2951792Smarcel */
3051792Smarcel
3151792Smarcel#ifndef _MACHINE_SIGFRAME_H_
3251907Smarcel#define	_MACHINE_SIGFRAME_H_
3351792Smarcel
3451907Smarcel/*
3551907Smarcel * Signal frames, arguments passed to application signal handlers.
3651907Smarcel */
3790776Sdeischen#ifdef _KERNEL
38105950Speter#ifdef COMPAT_43
3983047Sobrienstruct osigframe {
4051792Smarcel	/*
4153106Smarcel	 * The first four members may be used by applications.
4251792Smarcel	 */
4351792Smarcel
4451792Smarcel	register_t	sf_signum;
4551792Smarcel
4651792Smarcel	/*
4751792Smarcel	 * Either 'int' for old-style FreeBSD handler or 'siginfo_t *'
4851792Smarcel	 * pointing to sf_siginfo for SA_SIGINFO handlers.
4951792Smarcel	 */
5051792Smarcel	register_t	sf_arg2;
5151792Smarcel
5251792Smarcel	/* Points to sf_siginfo.si_sc. */
5351792Smarcel	register_t	sf_scp;
5451792Smarcel
5554120Smarcel	register_t	sf_addr;
5653106Smarcel
5751792Smarcel	/*
5851792Smarcel	 * The following arguments are not constrained by the
5951792Smarcel	 * function call protocol.
6051792Smarcel	 * Applications are not supposed to access these members,
6151792Smarcel	 * except using the pointers we provide in the first three
6251792Smarcel	 * arguments.
6351792Smarcel	 */
6451792Smarcel
6551792Smarcel	union {
6651792Smarcel		__osiginfohandler_t	*sf_action;
6751792Smarcel		__sighandler_t		*sf_handler;
6851792Smarcel	} sf_ahu;
6951792Smarcel
7051792Smarcel	/* In the SA_SIGINFO case, sf_arg2 points here. */
7151792Smarcel	osiginfo_t	sf_siginfo;
7251792Smarcel};
7390776Sdeischen#endif
74105950Speter#ifdef COMPAT_FREEBSD4
75105950Speter/* FreeBSD 4.x */
76105950Speterstruct sigframe4 {
77105950Speter	register_t	sf_signum;
78105950Speter	register_t	sf_siginfo;	/* code or pointer to sf_si */
79105950Speter	register_t	sf_ucontext;	/* points to sf_uc */
80105950Speter	register_t	sf_addr;	/* undocumented 4th arg */
8151792Smarcel
82105950Speter	union {
83105950Speter		__siginfohandler_t	*sf_action;
84105950Speter		__sighandler_t		*sf_handler;
85105950Speter	} sf_ahu;
86105950Speter	struct ucontext4 sf_uc;		/* = *sf_ucontext */
87105950Speter	siginfo_t	sf_si;		/* = *sf_siginfo (SA_SIGINFO case) */
88105950Speter};
89105950Speter#endif
90105950Speter#endif
91105950Speter
92247047Skib#include <x86/sigframe.h>
9351907Smarcel
9451907Smarcel#endif /* !_MACHINE_SIGFRAME_H_ */
95