signal.h revision 51942
180709Sjake/*
280709Sjake * Copyright (c) 1986, 1989, 1991, 1993
380709Sjake *	The Regents of the University of California.  All rights reserved.
480709Sjake *
580709Sjake * Redistribution and use in source and binary forms, with or without
680709Sjake * modification, are permitted provided that the following conditions
780709Sjake * are met:
880709Sjake * 1. Redistributions of source code must retain the above copyright
980709Sjake *    notice, this list of conditions and the following disclaimer.
1080709Sjake * 2. Redistributions in binary form must reproduce the above copyright
1180709Sjake *    notice, this list of conditions and the following disclaimer in the
1280709Sjake *    documentation and/or other materials provided with the distribution.
1380709Sjake * 3. All advertising materials mentioning features or use of this software
1481334Sobrien *    must display the following acknowledgement:
1580709Sjake *	This product includes software developed by the University of
1680709Sjake *	California, Berkeley and its contributors.
1781334Sobrien * 4. Neither the name of the University nor the names of its contributors
1880709Sjake *    may be used to endorse or promote products derived from this software
1980709Sjake *    without specific prior written permission.
2080709Sjake *
2180709Sjake * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2280709Sjake * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2380709Sjake * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2480709Sjake * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2580709Sjake * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2680709Sjake * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2780709Sjake * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2880709Sjake * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2980709Sjake * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3080709Sjake * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3180709Sjake * SUCH DAMAGE.
3284179Sjake *
3384179Sjake *	@(#)signal.h	8.1 (Berkeley) 6/11/93
3488630Sjake * $FreeBSD: head/sys/amd64/include/signal.h 51942 1999-10-04 19:33:58Z marcel $
3588630Sjake */
3688630Sjake
3788630Sjake#ifndef _MACHINE_SIGNAL_H_
3888630Sjake#define	_MACHINE_SIGNAL_H_
3988630Sjake
4088630Sjake/*
4188630Sjake * Machine-dependent signal definitions
4288630Sjake */
4388630Sjake
44154419Skristypedef int sig_atomic_t;
4588630Sjake
4688630Sjake#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
4788630Sjake
4888630Sjake#include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
4988630Sjake
5088630Sjake/*
5188630Sjake * Information pushed on stack when a signal is delivered.
5288630Sjake * This is used by the kernel to restore state following
5388630Sjake * execution of the signal handler.  It is also made available
5488630Sjake * to the handler to allow it to restore state properly if
5588630Sjake * a non-standard exit is performed.
5688630Sjake */
5788630Sjaketypedef unsigned int osigset_t;
5888630Sjake
5988630Sjakestruct	osigcontext {
6088630Sjake	int	sc_onstack;	/* sigstack state to restore */
6188630Sjake	osigset_t sc_mask;	/* signal mask to restore */
6288630Sjake	int	sc_esp;		/* machine state */
6388630Sjake	int	sc_ebp;
6488630Sjake	int	sc_isp;
6588630Sjake	int	sc_eip;
6688630Sjake	int	sc_efl;
6788630Sjake	int	sc_es;
68114257Sjake	int	sc_ds;
69114257Sjake	int	sc_cs;
7080709Sjake	int	sc_ss;
71114257Sjake	int	sc_edi;
72114257Sjake	int	sc_esi;
73114257Sjake	int	sc_ebx;
74114257Sjake	int	sc_edx;
7588630Sjake	int	sc_ecx;
7688630Sjake	int	sc_eax;
7788630Sjake	int	sc_gs;
7888630Sjake	int	sc_fs;
7988630Sjake	int	sc_trapno;
8088630Sjake	int	sc_err;
8188630Sjake};
8288630Sjake
8388630Sjake/*
8488630Sjake * The sequence of the fields/registers in sigcontext should match
8588630Sjake * those in mcontext_t.
8688781Sjake */
8788630Sjakestruct	sigcontext {
88105939Sjake	sigset_t sc_mask;		/* signal mask to restore */
89105939Sjake	int	sc_onstack;		/* sigstack state to restore */
9088630Sjake	int	sc_gs;
9188630Sjake	int	sc_fs;
9280709Sjake	int	sc_es;
93182773Smarius	int	sc_ds;
94190107Smarius	int	sc_edi;
9580709Sjake	int	sc_esi;
9680709Sjake	int	sc_ebp;
9784179Sjake	int	sc_isp;
9884179Sjake	int	sc_ebx;
9980709Sjake	int	sc_edx;
100	int	sc_ecx;
101	int	sc_eax;
102	int	sc_trapno;
103	int	sc_err;
104	int	sc_eip;
105	int	sc_cs;
106	int	sc_efl;
107	int	sc_esp;			/* machine state */
108	int	sc_ss;
109};
110
111#define sc_sp		sc_esp
112#define sc_fp		sc_ebp
113#define sc_pc		sc_eip
114#define sc_ps		sc_efl
115#define sc_eflags	sc_efl
116
117#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
118
119#endif /* !_MACHINE_SIGNAL_H_ */
120