signal.h revision 1.28
11.28Sad/*	$NetBSD: signal.h,v 1.28 2008/11/14 12:53:18 ad Exp $	*/
21.3Scgd
31.1Sbrezak/*
41.1Sbrezak * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
51.1Sbrezak * All rights reserved.
61.1Sbrezak *
71.1Sbrezak * Redistribution and use in source and binary forms, with or without
81.1Sbrezak * modification, are permitted provided that the following conditions
91.1Sbrezak * are met:
101.1Sbrezak * 1. Redistributions of source code must retain the above copyright
111.1Sbrezak *    notice, this list of conditions and the following disclaimer.
121.1Sbrezak * 2. Redistributions in binary form must reproduce the above copyright
131.1Sbrezak *    notice, this list of conditions and the following disclaimer in the
141.1Sbrezak *    documentation and/or other materials provided with the distribution.
151.17Sagc * 3. Neither the name of the University nor the names of its contributors
161.1Sbrezak *    may be used to endorse or promote products derived from this software
171.1Sbrezak *    without specific prior written permission.
181.1Sbrezak *
191.1Sbrezak * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
201.1Sbrezak * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
211.1Sbrezak * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
221.1Sbrezak * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
231.1Sbrezak * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
241.1Sbrezak * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
251.1Sbrezak * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
261.1Sbrezak * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
271.1Sbrezak * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
281.1Sbrezak * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
291.1Sbrezak * SUCH DAMAGE.
301.1Sbrezak *
311.3Scgd *	@(#)signal.h	7.16 (Berkeley) 3/17/91
321.1Sbrezak */
331.1Sbrezak
341.2Smycroft#ifndef _I386_SIGNAL_H_
351.2Smycroft#define _I386_SIGNAL_H_
361.1Sbrezak
371.16Sbjh21#include <sys/featuretest.h>
381.16Sbjh21
391.1Sbrezaktypedef int sig_atomic_t;
401.18Schristos
411.26Sdrochner#ifdef _KERNEL
421.24Schristos#define SIGTRAMP_VALID(vers)	((unsigned)(vers) <= 2)
431.26Sdrochner#endif
441.1Sbrezak
451.16Sbjh21#if defined(_NETBSD_SOURCE)
461.1Sbrezak/*
471.1Sbrezak * Get the "code" values
481.1Sbrezak */
491.1Sbrezak#include <machine/trap.h>
501.1Sbrezak
511.28Sad#if defined(_KERNEL)
521.1Sbrezak/*
531.1Sbrezak * Information pushed on stack when a signal is delivered.
541.1Sbrezak * This is used by the kernel to restore state following
551.1Sbrezak * execution of the signal handler.  It is also made available
561.1Sbrezak * to the handler to allow it to restore state properly if
571.1Sbrezak * a non-standard exit is performed.
581.1Sbrezak */
591.10Smycroftstruct sigcontext13 {
601.5Smycroft	int	sc_gs;
611.5Smycroft	int	sc_fs;
621.2Smycroft	int	sc_es;
631.2Smycroft	int	sc_ds;
641.2Smycroft	int	sc_edi;
651.2Smycroft	int	sc_esi;
661.2Smycroft	int	sc_ebp;
671.2Smycroft	int	sc_ebx;
681.2Smycroft	int	sc_edx;
691.2Smycroft	int	sc_ecx;
701.2Smycroft	int	sc_eax;
711.6Smycroft	/* XXX */
721.2Smycroft	int	sc_eip;
731.2Smycroft	int	sc_cs;
741.2Smycroft	int	sc_eflags;
751.2Smycroft	int	sc_esp;
761.2Smycroft	int	sc_ss;
771.5Smycroft
781.5Smycroft	int	sc_onstack;		/* sigstack state to restore */
791.13Sthorpej	int	sc_mask;		/* signal mask to restore (old style) */
801.6Smycroft
811.6Smycroft	int	sc_trapno;		/* XXX should be above */
821.6Smycroft	int	sc_err;
831.10Smycroft};
841.9Smycroft
851.10Smycroftstruct sigcontext {
861.10Smycroft	int	sc_gs;
871.10Smycroft	int	sc_fs;
881.10Smycroft	int	sc_es;
891.10Smycroft	int	sc_ds;
901.10Smycroft	int	sc_edi;
911.10Smycroft	int	sc_esi;
921.10Smycroft	int	sc_ebp;
931.10Smycroft	int	sc_ebx;
941.10Smycroft	int	sc_edx;
951.10Smycroft	int	sc_ecx;
961.10Smycroft	int	sc_eax;
971.10Smycroft	/* XXX */
981.10Smycroft	int	sc_eip;
991.10Smycroft	int	sc_cs;
1001.10Smycroft	int	sc_eflags;
1011.10Smycroft	int	sc_esp;
1021.10Smycroft	int	sc_ss;
1031.10Smycroft
1041.10Smycroft	int	sc_onstack;		/* sigstack state to restore */
1051.14Sthorpej	int	__sc_mask13;		/* signal mask to restore (old style) */
1061.10Smycroft
1071.10Smycroft	int	sc_trapno;		/* XXX should be above */
1081.10Smycroft	int	sc_err;
1091.10Smycroft
1101.10Smycroft	sigset_t sc_mask;		/* signal mask to restore (new style) */
1111.1Sbrezak};
1121.28Sad#endif /* _KERNEL */
1131.1Sbrezak
1141.16Sbjh21#endif	/* _NETBSD_SOURCE */
1151.4Sjtc#endif	/* !_I386_SIGNAL_H_ */
116