sigframe.h revision 54120
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 54120 1999-12-04 10:40:24Z 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 /* 4053106Smarcel * The first four 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 5454120Smarcel register_t sf_addr; 5553106Smarcel 5651792Smarcel /* 5751792Smarcel * The following arguments are not constrained by the 5851792Smarcel * function call protocol. 5951792Smarcel * Applications are not supposed to access these members, 6051792Smarcel * except using the pointers we provide in the first three 6151792Smarcel * arguments. 6251792Smarcel */ 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. 7653106Smarcel * 7751907Smarcel * NOTE: The 4th argument is undocumented, ill commented 7853106Smarcel * on and seems to be somewhat BSD "standard". Handlers 7953106Smarcel * installed with sigvec may be using it. 8051792Smarcel */ 8151792Smarcel register_t sf_signum; 8253106Smarcel register_t sf_siginfo; /* code or pointer to sf_si */ 8353106Smarcel register_t sf_ucontext; /* points to sf_uc */ 8454120Smarcel register_t sf_addr; /* undocumented 4th arg */ 8551907Smarcel 8651792Smarcel union { 8751792Smarcel __siginfohandler_t *sf_action; 8851792Smarcel __sighandler_t *sf_handler; 8951792Smarcel } sf_ahu; 9051984Smarcel ucontext_t sf_uc; /* = *sf_ucontext */ 9151792Smarcel siginfo_t sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ 9251792Smarcel}; 9351792Smarcel 9451907Smarcel#endif /* !_MACHINE_SIGFRAME_H_ */ 95