xref: /minix3/sys/arch/i386/include/signal.h (revision 2aa07764b89ad872b6f8dbfab6eff36a387b30d7)
17597f4a8SBen Gras /*	$NetBSD: signal.h,v 1.29 2008/11/19 18:35:59 ad Exp $	*/
27597f4a8SBen Gras 
37597f4a8SBen Gras /*
47597f4a8SBen Gras  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
57597f4a8SBen Gras  * All rights reserved.
67597f4a8SBen Gras  *
77597f4a8SBen Gras  * Redistribution and use in source and binary forms, with or without
87597f4a8SBen Gras  * modification, are permitted provided that the following conditions
97597f4a8SBen Gras  * are met:
107597f4a8SBen Gras  * 1. Redistributions of source code must retain the above copyright
117597f4a8SBen Gras  *    notice, this list of conditions and the following disclaimer.
127597f4a8SBen Gras  * 2. Redistributions in binary form must reproduce the above copyright
137597f4a8SBen Gras  *    notice, this list of conditions and the following disclaimer in the
147597f4a8SBen Gras  *    documentation and/or other materials provided with the distribution.
157597f4a8SBen Gras  * 3. Neither the name of the University nor the names of its contributors
167597f4a8SBen Gras  *    may be used to endorse or promote products derived from this software
177597f4a8SBen Gras  *    without specific prior written permission.
187597f4a8SBen Gras  *
197597f4a8SBen Gras  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
207597f4a8SBen Gras  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
217597f4a8SBen Gras  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
227597f4a8SBen Gras  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
237597f4a8SBen Gras  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
247597f4a8SBen Gras  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
257597f4a8SBen Gras  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
267597f4a8SBen Gras  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
277597f4a8SBen Gras  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
287597f4a8SBen Gras  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
297597f4a8SBen Gras  * SUCH DAMAGE.
307597f4a8SBen Gras  *
317597f4a8SBen Gras  *	@(#)signal.h	7.16 (Berkeley) 3/17/91
327597f4a8SBen Gras  */
337597f4a8SBen Gras 
34f6aac1c3SLionel Sambuc #ifndef _I386_SIGNAL_H_
35f6aac1c3SLionel Sambuc #define _I386_SIGNAL_H_
36f6aac1c3SLionel Sambuc 
37f6aac1c3SLionel Sambuc #include <sys/featuretest.h>
38f6aac1c3SLionel Sambuc 
39*2aa07764SAntoine Leca #if defined(__minix) && (defined(_LIBMINC) || ! defined(_STANDALONE))
407597f4a8SBen Gras #include <machine/fpu.h>
41*2aa07764SAntoine Leca #endif /* defined(__minix) ... */
427597f4a8SBen Gras 
43f6aac1c3SLionel Sambuc typedef int sig_atomic_t;
44f6aac1c3SLionel Sambuc 
457597f4a8SBen Gras #if defined(_NETBSD_SOURCE)
467597f4a8SBen Gras /*
477597f4a8SBen Gras  * Get the "code" values
48f6aac1c3SLionel Sambuc  */
497597f4a8SBen Gras #include <machine/trap.h>
50f6aac1c3SLionel Sambuc 
517597f4a8SBen Gras #if defined(_KERNEL) || defined(__minix)
527597f4a8SBen Gras /*
537597f4a8SBen Gras  * Information pushed on stack when a signal is delivered.
547597f4a8SBen Gras  * This is used by the kernel to restore state following
557597f4a8SBen Gras  * execution of the signal handler.  It is also made available
567597f4a8SBen Gras  * to the handler to allow it to restore state properly if
577597f4a8SBen Gras  * a non-standard exit is performed.
587597f4a8SBen Gras  */
597597f4a8SBen Gras struct sigcontext13 {
607597f4a8SBen Gras 	int	sc_gs;
617597f4a8SBen Gras 	int	sc_fs;
627597f4a8SBen Gras 	int	sc_es;
637597f4a8SBen Gras 	int	sc_ds;
647597f4a8SBen Gras 	int	sc_edi;
657597f4a8SBen Gras 	int	sc_esi;
667597f4a8SBen Gras 	int	sc_ebp;
677597f4a8SBen Gras 	int	sc_ebx;
687597f4a8SBen Gras 	int	sc_edx;
697597f4a8SBen Gras 	int	sc_ecx;
707597f4a8SBen Gras 	int	sc_eax;
717597f4a8SBen Gras 	/* XXX */
727597f4a8SBen Gras 	int	sc_eip;
737597f4a8SBen Gras 	int	sc_cs;
747597f4a8SBen Gras 	int	sc_eflags;
757597f4a8SBen Gras 	int	sc_esp;
767597f4a8SBen Gras 	int	sc_ss;
77f6aac1c3SLionel Sambuc 
787597f4a8SBen Gras 	int	sc_onstack;		/* sigstack state to restore */
797597f4a8SBen Gras 	int	sc_mask;		/* signal mask to restore (old style) */
807597f4a8SBen Gras 
817597f4a8SBen Gras 	int	sc_trapno;		/* XXX should be above */
827597f4a8SBen Gras 	int	sc_err;
83f6aac1c3SLionel Sambuc };
84f6aac1c3SLionel Sambuc 
85f6aac1c3SLionel Sambuc struct sigcontext {
867597f4a8SBen Gras 	int	sc_gs;
877597f4a8SBen Gras 	int	sc_fs;
887597f4a8SBen Gras 	int	sc_es;
897597f4a8SBen Gras 	int	sc_ds;
907597f4a8SBen Gras 	int	sc_edi;
917597f4a8SBen Gras 	int	sc_esi;
927597f4a8SBen Gras 	int	sc_ebp;
937597f4a8SBen Gras 	int	sc_ebx;
947597f4a8SBen Gras 	int	sc_edx;
957597f4a8SBen Gras 	int	sc_ecx;
967597f4a8SBen Gras 	int	sc_eax;
977597f4a8SBen Gras 	/* XXX */
987597f4a8SBen Gras 	int	sc_eip;
997597f4a8SBen Gras 	int	sc_cs;
1007597f4a8SBen Gras 	int	sc_eflags;
1017597f4a8SBen Gras 	int	sc_esp;
1027597f4a8SBen Gras 	int	sc_ss;
1037597f4a8SBen Gras 
1047597f4a8SBen Gras 	int	sc_onstack;		/* sigstack state to restore */
1057597f4a8SBen Gras 	int	__sc_mask13;		/* signal mask to restore (old style) */
1067597f4a8SBen Gras 
1077597f4a8SBen Gras 	int	sc_trapno;		/* XXX should be above */
1087597f4a8SBen Gras 	int	sc_err;
1097597f4a8SBen Gras 
1107597f4a8SBen Gras 	sigset_t sc_mask;		/* signal mask to restore (new style) */
111*2aa07764SAntoine Leca #if defined(__minix) && (defined(_LIBMINC) || ! defined(_STANDALONE))
112f6aac1c3SLionel Sambuc 	union fpu_state_u sc_fpu_state;
1137597f4a8SBen Gras 	int trap_style;		/* KTS_* method of entering kernel */
1147597f4a8SBen Gras 	int sc_flags;			/* MF_FPU_INITIALIZED if fpu state valid */
1157597f4a8SBen Gras #define SC_MAGIC 0xc0ffee1
1167597f4a8SBen Gras 	int sc_magic;
117*2aa07764SAntoine Leca #endif /* defined(__minix) ... */
118f6aac1c3SLionel Sambuc };
1197597f4a8SBen Gras #endif /* _KERNEL */
120f6aac1c3SLionel Sambuc 
121*2aa07764SAntoine Leca #if defined(__minix) && (defined(_LIBMINC) || ! defined(_STANDALONE))
122f6aac1c3SLionel Sambuc __BEGIN_DECLS
123f6aac1c3SLionel Sambuc int sigreturn(struct sigcontext *_scp);
124f6aac1c3SLionel Sambuc __END_DECLS
1257597f4a8SBen Gras #endif /* defined(__minix) */
126f6aac1c3SLionel Sambuc 
1277597f4a8SBen Gras #endif	/* _NETBSD_SOURCE */
128f6aac1c3SLionel Sambuc #endif	/* !_I386_SIGNAL_H_ */
129