signal.h revision 1.10
11.10Smycroft/* $NetBSD: signal.h,v 1.10 1998/09/12 10:48:28 mycroft 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.1Sbrezak * 3. All advertising materials mentioning features or use of this software 161.1Sbrezak * must display the following acknowledgement: 171.1Sbrezak * This product includes software developed by the University of 181.1Sbrezak * California, Berkeley and its contributors. 191.1Sbrezak * 4. Neither the name of the University nor the names of its contributors 201.1Sbrezak * may be used to endorse or promote products derived from this software 211.1Sbrezak * without specific prior written permission. 221.1Sbrezak * 231.1Sbrezak * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 241.1Sbrezak * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 251.1Sbrezak * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 261.1Sbrezak * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 271.1Sbrezak * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 281.1Sbrezak * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 291.1Sbrezak * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 301.1Sbrezak * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 311.1Sbrezak * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 321.1Sbrezak * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 331.1Sbrezak * SUCH DAMAGE. 341.1Sbrezak * 351.3Scgd * @(#)signal.h 7.16 (Berkeley) 3/17/91 361.1Sbrezak */ 371.1Sbrezak 381.2Smycroft#ifndef _I386_SIGNAL_H_ 391.2Smycroft#define _I386_SIGNAL_H_ 401.1Sbrezak 411.1Sbrezaktypedef int sig_atomic_t; 421.1Sbrezak 431.7Skleink#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \ 441.7Skleink !defined(_XOPEN_SOURCE) 451.1Sbrezak/* 461.1Sbrezak * Get the "code" values 471.1Sbrezak */ 481.1Sbrezak#include <machine/trap.h> 491.1Sbrezak 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.10Smycroft#if defined(__LIBC13_SOURCE__) || defined(_KERNEL) 581.10Smycroftstruct sigcontext13 { 591.5Smycroft int sc_gs; 601.5Smycroft int sc_fs; 611.2Smycroft int sc_es; 621.2Smycroft int sc_ds; 631.2Smycroft int sc_edi; 641.2Smycroft int sc_esi; 651.2Smycroft int sc_ebp; 661.2Smycroft int sc_ebx; 671.2Smycroft int sc_edx; 681.2Smycroft int sc_ecx; 691.2Smycroft int sc_eax; 701.6Smycroft /* XXX */ 711.2Smycroft int sc_eip; 721.2Smycroft int sc_cs; 731.2Smycroft int sc_eflags; 741.2Smycroft int sc_esp; 751.2Smycroft int sc_ss; 761.5Smycroft 771.5Smycroft int sc_onstack; /* sigstack state to restore */ 781.10Smycroft sigset13_t sc_mask; /* signal mask to restore (old style) */ 791.6Smycroft 801.6Smycroft int sc_trapno; /* XXX should be above */ 811.6Smycroft int sc_err; 821.10Smycroft}; 831.10Smycroft#endif 841.9Smycroft 851.10Smycroftstruct sigcontext { 861.10Smycroft int sc_gs; 871.10Smycroft int sc_fs; 881.10Smycroft int sc_es; 891.10Smycroft int sc_ds; 901.10Smycroft int sc_edi; 911.10Smycroft int sc_esi; 921.10Smycroft int sc_ebp; 931.10Smycroft int sc_ebx; 941.10Smycroft int sc_edx; 951.10Smycroft int sc_ecx; 961.10Smycroft int sc_eax; 971.10Smycroft /* XXX */ 981.10Smycroft int sc_eip; 991.10Smycroft int sc_cs; 1001.10Smycroft int sc_eflags; 1011.10Smycroft int sc_esp; 1021.10Smycroft int sc_ss; 1031.10Smycroft 1041.10Smycroft int sc_onstack; /* sigstack state to restore */ 1051.10Smycroft int __sc_unused; 1061.10Smycroft 1071.10Smycroft int sc_trapno; /* XXX should be above */ 1081.10Smycroft int sc_err; 1091.10Smycroft 1101.10Smycroft sigset_t sc_mask; /* signal mask to restore (new style) */ 1111.1Sbrezak}; 1121.1Sbrezak 1131.1Sbrezak#define sc_sp sc_esp 1141.1Sbrezak#define sc_fp sc_ebp 1151.1Sbrezak#define sc_pc sc_eip 1161.2Smycroft#define sc_ps sc_eflags 1171.1Sbrezak 1181.7Skleink#endif /* !_ANSI_SOURCE && !_POSIX_C_SOURCE && !_XOPEN_SOURCE */ 1191.4Sjtc#endif /* !_I386_SIGNAL_H_ */ 120