signal.h revision 190623
1228072Sbapt/*- 2228072Sbapt * Copyright (c) 1986, 1989, 1991, 1993 3228072Sbapt * The Regents of the University of California. All rights reserved. 4228072Sbapt * 5228072Sbapt * Redistribution and use in source and binary forms, with or without 6228072Sbapt * modification, are permitted provided that the following conditions 7228072Sbapt * are met: 8228072Sbapt * 1. Redistributions of source code must retain the above copyright 9228072Sbapt * notice, this list of conditions and the following disclaimer. 10228072Sbapt * 2. Redistributions in binary form must reproduce the above copyright 11228072Sbapt * notice, this list of conditions and the following disclaimer in the 12228072Sbapt * documentation and/or other materials provided with the distribution. 13228072Sbapt * 4. Neither the name of the University nor the names of its contributors 14228072Sbapt * may be used to endorse or promote products derived from this software 15228072Sbapt * without specific prior written permission. 16228072Sbapt * 17228072Sbapt * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18228072Sbapt * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19228072Sbapt * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20228072Sbapt * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21228072Sbapt * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22228072Sbapt * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23228072Sbapt * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24228072Sbapt * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25228072Sbapt * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26228072Sbapt * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27228072Sbapt * SUCH DAMAGE. 28228072Sbapt * 29228072Sbapt * @(#)signal.h 8.1 (Berkeley) 6/11/93 30228072Sbapt * $FreeBSD: head/sys/i386/include/signal.h 190623 2009-04-01 13:44:28Z kib $ 31228072Sbapt */ 32228072Sbapt 33228072Sbapt#ifndef _MACHINE_SIGNAL_H_ 34228072Sbapt#define _MACHINE_SIGNAL_H_ 35228072Sbapt 36228072Sbapt#include <sys/cdefs.h> 37228072Sbapt#include <sys/_sigset.h> 38228072Sbapt 39228072Sbapt/* 40228072Sbapt * Machine-dependent signal definitions 41228072Sbapt */ 42228072Sbapt 43228072Sbapttypedef int sig_atomic_t; 44228072Sbapt 45228072Sbapt#if __BSD_VISIBLE 46228072Sbapt#include <machine/trap.h> /* codes for SIGILL, SIGFPE */ 47228072Sbapt 48228072Sbapt/* 49228072Sbapt * Only the kernel should need these old type definitions. 50228072Sbapt */ 51228072Sbapt#if defined(_KERNEL) && defined(COMPAT_43) 52228072Sbapt/* 53228072Sbapt * Information pushed on stack when a signal is delivered. 54228072Sbapt * This is used by the kernel to restore state following 55228072Sbapt * execution of the signal handler. It is also made available 56228072Sbapt * to the handler to allow it to restore state properly if 57228072Sbapt * a non-standard exit is performed. 58228072Sbapt */ 59228072Sbaptstruct osigcontext { 60228072Sbapt int sc_onstack; /* sigstack state to restore */ 61228072Sbapt osigset_t sc_mask; /* signal mask to restore */ 62228072Sbapt int sc_esp; /* machine state follows: */ 63228072Sbapt int sc_ebp; 64228072Sbapt int sc_isp; 65228072Sbapt int sc_eip; 66228072Sbapt int sc_efl; 67228072Sbapt int sc_es; 68228072Sbapt int sc_ds; 69228072Sbapt int sc_cs; 70228072Sbapt int sc_ss; 71228072Sbapt int sc_edi; 72228072Sbapt int sc_esi; 73228072Sbapt int sc_ebx; 74228072Sbapt int sc_edx; 75228072Sbapt int sc_ecx; 76228072Sbapt int sc_eax; 77228072Sbapt int sc_gs; 78228072Sbapt int sc_fs; 79228072Sbapt int sc_trapno; 80228072Sbapt int sc_err; 81228072Sbapt}; 82228072Sbapt#endif 83228072Sbapt 84228072Sbapt/* 85228072Sbapt * The sequence of the fields/registers in struct sigcontext should match 86228072Sbapt * those in mcontext_t. 87228072Sbapt */ 88228072Sbaptstruct sigcontext { 89228072Sbapt struct __sigset sc_mask; /* signal mask to restore */ 90228072Sbapt int sc_onstack; /* sigstack state to restore */ 91228072Sbapt int sc_gs; /* machine state (struct trapframe) */ 92228072Sbapt int sc_fs; 93228072Sbapt int sc_es; 94228072Sbapt int sc_ds; 95228072Sbapt int sc_edi; 96228072Sbapt int sc_esi; 97228072Sbapt int sc_ebp; 98228072Sbapt int sc_isp; 99228072Sbapt int sc_ebx; 100228072Sbapt int sc_edx; 101228072Sbapt int sc_ecx; 102228072Sbapt int sc_eax; 103228072Sbapt int sc_trapno; 104228072Sbapt int sc_err; 105228072Sbapt int sc_eip; 106228072Sbapt int sc_cs; 107228072Sbapt int sc_efl; 108228072Sbapt int sc_esp; 109228072Sbapt int sc_ss; 110228072Sbapt int sc_len; /* sizeof(mcontext_t) */ 111228072Sbapt /* 112228072Sbapt * XXX - See <machine/ucontext.h> and <machine/npx.h> for 113228072Sbapt * the following fields. 114228072Sbapt */ 115228072Sbapt int sc_fpformat; 116228072Sbapt int sc_ownedfp; 117228072Sbapt int sc_spare1[1]; 118228072Sbapt int sc_fpstate[128] __aligned(16); 119228072Sbapt 120228072Sbapt int sc_fsbase; 121228072Sbapt int sc_gsbase; 122228072Sbapt 123228072Sbapt int sc_spare2[6]; 124228072Sbapt}; 125228072Sbapt 126228072Sbapt#define sc_sp sc_esp 127228072Sbapt#define sc_fp sc_ebp 128228072Sbapt#define sc_pc sc_eip 129228072Sbapt#define sc_ps sc_efl 130228072Sbapt#define sc_eflags sc_efl 131228072Sbapt 132228072Sbapt#endif /* __BSD_VISIBLE */ 133228072Sbapt 134228072Sbapt#endif /* !_MACHINE_SIGNAL_H_ */ 135228072Sbapt