1*32db0bedSmiod /* $OpenBSD: signal.h,v 1.13 2024/03/29 21:16:38 miod Exp $ */ 2de24d0bcSjason /* $NetBSD: signal.h,v 1.10 2001/05/09 19:50:49 kleink Exp $ */ 3de24d0bcSjason 4de24d0bcSjason /* 5de24d0bcSjason * Copyright (c) 1992, 1993 6de24d0bcSjason * The Regents of the University of California. All rights reserved. 7de24d0bcSjason * 8de24d0bcSjason * This software was developed by the Computer Systems Engineering group 9de24d0bcSjason * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 10de24d0bcSjason * contributed to Berkeley. 11de24d0bcSjason * 12de24d0bcSjason * All advertising materials mentioning features or use of this software 13de24d0bcSjason * must display the following acknowledgement: 14de24d0bcSjason * This product includes software developed by the University of 15de24d0bcSjason * California, Lawrence Berkeley Laboratory. 16de24d0bcSjason * 17de24d0bcSjason * Redistribution and use in source and binary forms, with or without 18de24d0bcSjason * modification, are permitted provided that the following conditions 19de24d0bcSjason * are met: 20de24d0bcSjason * 1. Redistributions of source code must retain the above copyright 21de24d0bcSjason * notice, this list of conditions and the following disclaimer. 22de24d0bcSjason * 2. Redistributions in binary form must reproduce the above copyright 23de24d0bcSjason * notice, this list of conditions and the following disclaimer in the 24de24d0bcSjason * documentation and/or other materials provided with the distribution. 2529295d1cSmillert * 3. Neither the name of the University nor the names of its contributors 26de24d0bcSjason * may be used to endorse or promote products derived from this software 27de24d0bcSjason * without specific prior written permission. 28de24d0bcSjason * 29de24d0bcSjason * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 30de24d0bcSjason * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 31de24d0bcSjason * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 32de24d0bcSjason * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 33de24d0bcSjason * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34de24d0bcSjason * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35de24d0bcSjason * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36de24d0bcSjason * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37de24d0bcSjason * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 38de24d0bcSjason * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 39de24d0bcSjason * SUCH DAMAGE. 40de24d0bcSjason * 41de24d0bcSjason * @(#)signal.h 8.1 (Berkeley) 6/11/93 42de24d0bcSjason */ 43de24d0bcSjason 442fa72412Spirofti #ifndef _MACHINE_SIGNAL_H_ 452fa72412Spirofti #define _MACHINE_SIGNAL_H_ 467c2ef5d9Smillert 477c2ef5d9Smillert #include <sys/cdefs.h> 48de24d0bcSjason 497455ef2bSderaadt typedef int sig_atomic_t; 50de24d0bcSjason 519fa6b648Smillert #if __BSD_VISIBLE || __XPG_VISIBLE >= 420 52de24d0bcSjason /* 53de24d0bcSjason * Information pushed on stack when a signal is delivered. 54de24d0bcSjason * This is used by the kernel to restore state following 55de24d0bcSjason * execution of the signal handler. It is also made available 56de24d0bcSjason * to the handler to allow it to restore state properly if 57de24d0bcSjason * a non-standard exit is performed. 58de24d0bcSjason */ 59de24d0bcSjason struct sigcontext { 607730d1d9Sderaadt long sc_cookie; 61de24d0bcSjason /* begin machine dependent portion */ 62de24d0bcSjason long sc_sp; /* %sp to restore */ 63de24d0bcSjason long sc_pc; /* pc to restore */ 64de24d0bcSjason long sc_npc; /* npc to restore */ 65de24d0bcSjason long sc_tstate; /* tstate to restore */ 66de24d0bcSjason long sc_g1; /* %g1 to restore */ 67de24d0bcSjason long sc_o0; /* %o0 to restore */ 687730d1d9Sderaadt int sc_mask; /* signal mask to restore */ 69de24d0bcSjason }; 709fa6b648Smillert #endif /* __BSD_VISIBLE || __XPG_VISIBLE >= 420 */ 71de24d0bcSjason 72*32db0bedSmiod #if defined(_KERNEL) 73de24d0bcSjason /* 74de24d0bcSjason * `Code' arguments to signal handlers. The names, and the funny numbering. 75de24d0bcSjason * are defined so as to match up with what SunOS uses; I have no idea why 76de24d0bcSjason * they did the numbers that way, except maybe to match up with the 68881. 77de24d0bcSjason */ 78de24d0bcSjason #define FPE_INTOVF_TRAP 0x01 /* integer overflow */ 79de24d0bcSjason #define FPE_INTDIV_TRAP 0x14 /* integer divide by zero */ 80de24d0bcSjason #define FPE_FLTINEX_TRAP 0xc4 /* inexact */ 81de24d0bcSjason #define FPE_FLTDIV_TRAP 0xc8 /* divide by zero */ 82de24d0bcSjason #define FPE_FLTUND_TRAP 0xcc /* underflow */ 83de24d0bcSjason #define FPE_FLTOPERR_TRAP 0xd0 /* operand error */ 84de24d0bcSjason #define FPE_FLTOVF_TRAP 0xd4 /* overflow */ 852763461aSmillert #endif 86de24d0bcSjason 872fa72412Spirofti #endif /* !_MACHINE_SIGNAL_H_ */ 88