166458Sdfr/* $FreeBSD$ */ 266458Sdfr/* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */ 366458Sdfr 4139790Simp/*- 566458Sdfr * Copyright (c) 1994, 1995 Carnegie-Mellon University. 666458Sdfr * All rights reserved. 766458Sdfr * 866458Sdfr * Author: Chris G. Demetriou 966458Sdfr * 1066458Sdfr * Permission to use, copy, modify and distribute this software and 1166458Sdfr * its documentation is hereby granted, provided that both the copyright 1266458Sdfr * notice and this permission notice appear in all copies of the 1366458Sdfr * software, derivative works or modified versions, and any portions 1466458Sdfr * thereof, and that both notices appear in supporting documentation. 1566458Sdfr * 1666458Sdfr * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 1766458Sdfr * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 1866458Sdfr * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 1966458Sdfr * 2066458Sdfr * Carnegie Mellon requests users of this software to return to 2166458Sdfr * 2266458Sdfr * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 2366458Sdfr * School of Computer Science 2466458Sdfr * Carnegie Mellon University 2566458Sdfr * Pittsburgh PA 15213-3890 2666458Sdfr * 2766458Sdfr * any improvements or extensions that they make and grant Carnegie the 2866458Sdfr * rights to redistribute these changes. 2966458Sdfr */ 3066458Sdfr 3166458Sdfr#ifndef _MACHINE_SIGNAL_H_ 3266458Sdfr#define _MACHINE_SIGNAL_H_ 3366458Sdfr 34105014Smike#include <sys/cdefs.h> 35105014Smike#include <sys/_sigset.h> 36105014Smike 3766458Sdfrtypedef long sig_atomic_t; 3866458Sdfr 39105014Smike#if __BSD_VISIBLE 4094375Sdfr/* portable macros for SIGFPE/ARITHTRAP */ 4194375Sdfr#define FPE_INTOVF 1 /* integer overflow */ 4294375Sdfr#define FPE_INTDIV 2 /* integer divide by zero */ 4394375Sdfr#define FPE_FLTDIV 3 /* floating point divide by zero */ 4494375Sdfr#define FPE_FLTOVF 4 /* floating point overflow */ 4594375Sdfr#define FPE_FLTUND 5 /* floating point underflow */ 4694375Sdfr#define FPE_FLTRES 6 /* floating point inexact result */ 4794375Sdfr#define FPE_FLTINV 7 /* invalid floating point operation */ 4894375Sdfr#define FPE_FLTSUB 8 /* subscript out of range */ 4994375Sdfr 5094375Sdfr#define BUS_SEGM_FAULT 30 /* segment protection base */ 51105014Smike#endif 5294375Sdfr 5366458Sdfr/* 5466458Sdfr * Information pushed on stack when a signal is delivered. 5566458Sdfr * This is used by the kernel to restore state following 5666458Sdfr * execution of the signal handler. It is also made available 5766458Sdfr * to the handler to allow it to restore state properly if 5866458Sdfr * a non-standard exit is performed. 5966458Sdfr */ 6066458Sdfr 61105014Smike#if __BSD_VISIBLE 62115084Smarcel#include <machine/_regset.h> 63115084Smarcel 6466458Sdfr/* 6566458Sdfr * The sequence of the fields should match those in 6666458Sdfr * mcontext_t. Keep them in sync! 6766458Sdfr */ 6883047Sobrienstruct sigcontext { 69115084Smarcel struct __sigset sc_mask; /* signal mask to restore */ 70115084Smarcel unsigned long sc_onstack; 71115084Smarcel unsigned long sc_flags; 72115084Smarcel struct _special sc_special; 73115084Smarcel struct _callee_saved sc_preserved; 74115084Smarcel struct _callee_saved_fp sc_preserved_fp; 75115084Smarcel struct _caller_saved sc_scratch; 76115084Smarcel struct _caller_saved_fp sc_scratch_fp; 77115084Smarcel struct _high_fp sc_high_fp; 7866458Sdfr}; 79105014Smike#endif /* __BSD_VISIBLE */ 8066458Sdfr 8166458Sdfr#endif /* !_MACHINE_SIGNAL_H_*/ 82