signal.h revision 51942
11543Srgrimes/*
21543Srgrimes * Copyright (c) 1986, 1989, 1991, 1993
31543Srgrimes *	The Regents of the University of California.  All rights reserved.
41543Srgrimes *
51543Srgrimes * Redistribution and use in source and binary forms, with or without
61543Srgrimes * modification, are permitted provided that the following conditions
71543Srgrimes * are met:
81543Srgrimes * 1. Redistributions of source code must retain the above copyright
91543Srgrimes *    notice, this list of conditions and the following disclaimer.
101543Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111543Srgrimes *    notice, this list of conditions and the following disclaimer in the
121543Srgrimes *    documentation and/or other materials provided with the distribution.
131543Srgrimes * 3. All advertising materials mentioning features or use of this software
141543Srgrimes *    must display the following acknowledgement:
151543Srgrimes *	This product includes software developed by the University of
161543Srgrimes *	California, Berkeley and its contributors.
171543Srgrimes * 4. Neither the name of the University nor the names of its contributors
181543Srgrimes *    may be used to endorse or promote products derived from this software
191543Srgrimes *    without specific prior written permission.
201543Srgrimes *
211543Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221543Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231543Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241543Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251543Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261543Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271543Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281543Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291543Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301543Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311543Srgrimes * SUCH DAMAGE.
321543Srgrimes *
331543Srgrimes *	@(#)signal.h	8.1 (Berkeley) 6/11/93
3450477Speter * $FreeBSD: head/sys/amd64/include/signal.h 51942 1999-10-04 19:33:58Z marcel $
351543Srgrimes */
361543Srgrimes
379343Sbde#ifndef _MACHINE_SIGNAL_H_
389343Sbde#define	_MACHINE_SIGNAL_H_
392166Spaul
401543Srgrimes/*
411543Srgrimes * Machine-dependent signal definitions
421543Srgrimes */
431543Srgrimes
441543Srgrimestypedef int sig_atomic_t;
451543Srgrimes
469343Sbde#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
479343Sbde
481543Srgrimes#include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
491543Srgrimes
501543Srgrimes/*
511543Srgrimes * Information pushed on stack when a signal is delivered.
521543Srgrimes * This is used by the kernel to restore state following
531543Srgrimes * execution of the signal handler.  It is also made available
541543Srgrimes * to the handler to allow it to restore state properly if
551543Srgrimes * a non-standard exit is performed.
561543Srgrimes */
5751792Smarceltypedef unsigned int osigset_t;
5851792Smarcel
5951792Smarcelstruct	osigcontext {
6051942Smarcel	int	sc_onstack;	/* sigstack state to restore */
6151942Smarcel	osigset_t sc_mask;	/* signal mask to restore */
6251942Smarcel	int	sc_esp;		/* machine state */
6351942Smarcel	int	sc_ebp;
6451942Smarcel	int	sc_isp;
6551942Smarcel	int	sc_eip;
6651942Smarcel	int	sc_efl;
6751942Smarcel	int	sc_es;
6851942Smarcel	int	sc_ds;
6951942Smarcel	int	sc_cs;
7051942Smarcel	int	sc_ss;
7151942Smarcel	int	sc_edi;
7251942Smarcel	int	sc_esi;
7351942Smarcel	int	sc_ebx;
7451942Smarcel	int	sc_edx;
7551942Smarcel	int	sc_ecx;
7651942Smarcel	int	sc_eax;
7751942Smarcel	int	sc_gs;
7851942Smarcel	int	sc_fs;
7951942Smarcel	int	sc_trapno;
8051942Smarcel	int	sc_err;
8151942Smarcel};
8251942Smarcel
8351942Smarcel/*
8451942Smarcel * The sequence of the fields/registers in sigcontext should match
8551942Smarcel * those in mcontext_t.
8651942Smarcel */
8751942Smarcelstruct	sigcontext {
8851942Smarcel	sigset_t sc_mask;		/* signal mask to restore */
8951942Smarcel	int	sc_onstack;		/* sigstack state to restore */
9051942Smarcel	int	sc_gs;
9151942Smarcel	int	sc_fs;
9251942Smarcel	int	sc_es;
9351942Smarcel	int	sc_ds;
9451942Smarcel	int	sc_edi;
9551942Smarcel	int	sc_esi;
9651942Smarcel	int	sc_ebp;
9751942Smarcel	int	sc_isp;
9851942Smarcel	int	sc_ebx;
9951942Smarcel	int	sc_edx;
10051942Smarcel	int	sc_ecx;
10151942Smarcel	int	sc_eax;
10251942Smarcel	int	sc_trapno;
10351942Smarcel	int	sc_err;
10451942Smarcel	int	sc_eip;
10551942Smarcel	int	sc_cs;
10651942Smarcel	int	sc_efl;
10751942Smarcel	int	sc_esp;			/* machine state */
10851942Smarcel	int	sc_ss;
10951942Smarcel};
11051942Smarcel
11151792Smarcel#define sc_sp		sc_esp
11251792Smarcel#define sc_fp		sc_ebp
11351792Smarcel#define sc_pc		sc_eip
11451792Smarcel#define sc_ps		sc_efl
11551792Smarcel#define sc_eflags	sc_efl
1162166Spaul
1179343Sbde#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
1189343Sbde
1199343Sbde#endif /* !_MACHINE_SIGNAL_H_ */
120