1139790Simp/*-
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 * 4. Neither the name of the University nor the names of its contributors
141543Srgrimes *    may be used to endorse or promote products derived from this software
151543Srgrimes *    without specific prior written permission.
161543Srgrimes *
171543Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181543Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191543Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201543Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211543Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221543Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231543Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241543Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251543Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261543Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271543Srgrimes * SUCH DAMAGE.
281543Srgrimes *
291543Srgrimes *	@(#)signal.h	8.1 (Berkeley) 6/11/93
3050477Speter * $FreeBSD$
311543Srgrimes */
321543Srgrimes
339343Sbde#ifndef _MACHINE_SIGNAL_H_
349343Sbde#define	_MACHINE_SIGNAL_H_
352166Spaul
36105014Smike#include <sys/cdefs.h>
37105014Smike#include <sys/_sigset.h>
38105014Smike
391543Srgrimes/*
401543Srgrimes * Machine-dependent signal definitions
411543Srgrimes */
421543Srgrimes
431543Srgrimestypedef int sig_atomic_t;
441543Srgrimes
45105014Smike#if __BSD_VISIBLE
461543Srgrimes#include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
471543Srgrimes
481543Srgrimes/*
491543Srgrimes * Information pushed on stack when a signal is delivered.
501543Srgrimes * This is used by the kernel to restore state following
511543Srgrimes * execution of the signal handler.  It is also made available
521543Srgrimes * to the handler to allow it to restore state properly if
531543Srgrimes * a non-standard exit is performed.
541543Srgrimes */
55229023Skib
56229023Skib#if defined(_KERNEL) && defined(COMPAT_43)
57229023Skib/*
58229023Skib * Only the kernel should need these old type definitions.
59229023Skib */
6083047Sobrienstruct osigcontext {
6153108Smarcel	int	sc_onstack;		/* sigstack state to restore */
6253108Smarcel	osigset_t sc_mask;		/* signal mask to restore */
6353108Smarcel	int	sc_esp;			/* machine state follows: */
6451942Smarcel	int	sc_ebp;
6551942Smarcel	int	sc_isp;
6651942Smarcel	int	sc_eip;
6751942Smarcel	int	sc_efl;
6851942Smarcel	int	sc_es;
6951942Smarcel	int	sc_ds;
7051942Smarcel	int	sc_cs;
7151942Smarcel	int	sc_ss;
7251942Smarcel	int	sc_edi;
7351942Smarcel	int	sc_esi;
7451942Smarcel	int	sc_ebx;
7551942Smarcel	int	sc_edx;
7651942Smarcel	int	sc_ecx;
7751942Smarcel	int	sc_eax;
7851942Smarcel	int	sc_gs;
7951942Smarcel	int	sc_fs;
8051942Smarcel	int	sc_trapno;
8151942Smarcel	int	sc_err;
8251942Smarcel};
8390776Sdeischen#endif
8451942Smarcel
8551942Smarcel/*
8653108Smarcel * The sequence of the fields/registers in struct sigcontext should match
87229023Skib * those in mcontext_t and struct trapframe.
8851942Smarcel */
8983047Sobrienstruct sigcontext {
90105014Smike	struct __sigset sc_mask;	/* signal mask to restore */
9151942Smarcel	int	sc_onstack;		/* sigstack state to restore */
92107521Sdeischen	int	sc_gs;			/* machine state (struct trapframe) */
9351942Smarcel	int	sc_fs;
9451942Smarcel	int	sc_es;
9551942Smarcel	int	sc_ds;
9651942Smarcel	int	sc_edi;
9751942Smarcel	int	sc_esi;
9851942Smarcel	int	sc_ebp;
9951942Smarcel	int	sc_isp;
10051942Smarcel	int	sc_ebx;
10151942Smarcel	int	sc_edx;
10251942Smarcel	int	sc_ecx;
10351942Smarcel	int	sc_eax;
10451942Smarcel	int	sc_trapno;
10551942Smarcel	int	sc_err;
10651942Smarcel	int	sc_eip;
10751942Smarcel	int	sc_cs;
10851942Smarcel	int	sc_efl;
10953108Smarcel	int	sc_esp;
11051942Smarcel	int	sc_ss;
111106977Sdeischen	int	sc_len;			/* sizeof(mcontext_t) */
11253108Smarcel	/*
113229023Skib	 * See <machine/ucontext.h> and <machine/npx.h> for
114229023Skib	 * the following fields.
11553108Smarcel	 */
116103408Smini	int	sc_fpformat;
117103408Smini	int	sc_ownedfp;
118231979Skib	int	sc_flags;
119107521Sdeischen	int	sc_fpstate[128] __aligned(16);
120190623Skib
121190623Skib	int	sc_fsbase;
122190623Skib	int	sc_gsbase;
123190623Skib
124231979Skib	int	sc_xfpustate;
125231979Skib	int	sc_xfpustate_len;
126231979Skib
127231979Skib	int	sc_spare2[4];
12851942Smarcel};
12951942Smarcel
13053108Smarcel#define	sc_sp		sc_esp
13153108Smarcel#define	sc_fp		sc_ebp
13253108Smarcel#define	sc_pc		sc_eip
13353108Smarcel#define	sc_ps		sc_efl
13453108Smarcel#define	sc_eflags	sc_efl
1352166Spaul
136105014Smike#endif /* __BSD_VISIBLE */
1379343Sbde
1389343Sbde#endif /* !_MACHINE_SIGNAL_H_ */
139