signal.h revision 1.31
11.31Sthorpej/* $NetBSD: signal.h,v 1.31 2021/10/29 01:04:53 thorpej Exp $ */ 21.3Scgd 31.1Sbrezak/* 41.1Sbrezak * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California. 51.1Sbrezak * All rights reserved. 61.1Sbrezak * 71.1Sbrezak * Redistribution and use in source and binary forms, with or without 81.1Sbrezak * modification, are permitted provided that the following conditions 91.1Sbrezak * are met: 101.1Sbrezak * 1. Redistributions of source code must retain the above copyright 111.1Sbrezak * notice, this list of conditions and the following disclaimer. 121.1Sbrezak * 2. Redistributions in binary form must reproduce the above copyright 131.1Sbrezak * notice, this list of conditions and the following disclaimer in the 141.1Sbrezak * documentation and/or other materials provided with the distribution. 151.17Sagc * 3. Neither the name of the University nor the names of its contributors 161.1Sbrezak * may be used to endorse or promote products derived from this software 171.1Sbrezak * without specific prior written permission. 181.1Sbrezak * 191.1Sbrezak * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 201.1Sbrezak * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 211.1Sbrezak * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 221.1Sbrezak * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 231.1Sbrezak * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 241.1Sbrezak * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 251.1Sbrezak * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 261.1Sbrezak * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 271.1Sbrezak * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 281.1Sbrezak * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 291.1Sbrezak * SUCH DAMAGE. 301.1Sbrezak * 311.3Scgd * @(#)signal.h 7.16 (Berkeley) 3/17/91 321.1Sbrezak */ 331.1Sbrezak 341.2Smycroft#ifndef _I386_SIGNAL_H_ 351.2Smycroft#define _I386_SIGNAL_H_ 361.1Sbrezak 371.16Sbjh21#include <sys/featuretest.h> 381.16Sbjh21 391.1Sbrezaktypedef int sig_atomic_t; 401.18Schristos 411.31Sthorpej#define __HAVE_STRUCT_SIGCONTEXT 421.31Sthorpej 431.16Sbjh21#if defined(_NETBSD_SOURCE) 441.1Sbrezak/* 451.1Sbrezak * Get the "code" values 461.1Sbrezak */ 471.1Sbrezak#include <machine/trap.h> 481.1Sbrezak 491.28Sad#if defined(_KERNEL) 501.1Sbrezak/* 511.1Sbrezak * Information pushed on stack when a signal is delivered. 521.1Sbrezak * This is used by the kernel to restore state following 531.1Sbrezak * execution of the signal handler. It is also made available 541.1Sbrezak * to the handler to allow it to restore state properly if 551.1Sbrezak * a non-standard exit is performed. 561.1Sbrezak */ 571.10Smycroftstruct sigcontext13 { 581.5Smycroft int sc_gs; 591.5Smycroft int sc_fs; 601.2Smycroft int sc_es; 611.2Smycroft int sc_ds; 621.2Smycroft int sc_edi; 631.2Smycroft int sc_esi; 641.2Smycroft int sc_ebp; 651.2Smycroft int sc_ebx; 661.2Smycroft int sc_edx; 671.2Smycroft int sc_ecx; 681.2Smycroft int sc_eax; 691.6Smycroft /* XXX */ 701.2Smycroft int sc_eip; 711.2Smycroft int sc_cs; 721.2Smycroft int sc_eflags; 731.2Smycroft int sc_esp; 741.2Smycroft int sc_ss; 751.5Smycroft 761.5Smycroft int sc_onstack; /* sigstack state to restore */ 771.13Sthorpej int sc_mask; /* signal mask to restore (old style) */ 781.6Smycroft 791.6Smycroft int sc_trapno; /* XXX should be above */ 801.6Smycroft int sc_err; 811.10Smycroft}; 821.9Smycroft 831.10Smycroftstruct sigcontext { 841.10Smycroft int sc_gs; 851.10Smycroft int sc_fs; 861.10Smycroft int sc_es; 871.10Smycroft int sc_ds; 881.10Smycroft int sc_edi; 891.10Smycroft int sc_esi; 901.10Smycroft int sc_ebp; 911.10Smycroft int sc_ebx; 921.10Smycroft int sc_edx; 931.10Smycroft int sc_ecx; 941.10Smycroft int sc_eax; 951.10Smycroft /* XXX */ 961.10Smycroft int sc_eip; 971.10Smycroft int sc_cs; 981.10Smycroft int sc_eflags; 991.10Smycroft int sc_esp; 1001.10Smycroft int sc_ss; 1011.10Smycroft 1021.10Smycroft int sc_onstack; /* sigstack state to restore */ 1031.14Sthorpej int __sc_mask13; /* signal mask to restore (old style) */ 1041.10Smycroft 1051.10Smycroft int sc_trapno; /* XXX should be above */ 1061.10Smycroft int sc_err; 1071.10Smycroft 1081.10Smycroft sigset_t sc_mask; /* signal mask to restore (new style) */ 1091.1Sbrezak}; 1101.28Sad#endif /* _KERNEL */ 1111.1Sbrezak 1121.16Sbjh21#endif /* _NETBSD_SOURCE */ 1131.4Sjtc#endif /* !_I386_SIGNAL_H_ */ 114