1139731Simp/*-
2122296Speter * Copyright (c) 2003 Peter Wemm.
31543Srgrimes * Copyright (c) 1986, 1989, 1991, 1993
41543Srgrimes *	The Regents of the University of California.  All rights reserved.
51543Srgrimes *
61543Srgrimes * Redistribution and use in source and binary forms, with or without
71543Srgrimes * modification, are permitted provided that the following conditions
81543Srgrimes * are met:
91543Srgrimes * 1. Redistributions of source code must retain the above copyright
101543Srgrimes *    notice, this list of conditions and the following disclaimer.
111543Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
121543Srgrimes *    notice, this list of conditions and the following disclaimer in the
131543Srgrimes *    documentation and/or other materials provided with the distribution.
141543Srgrimes * 4. Neither the name of the University nor the names of its contributors
151543Srgrimes *    may be used to endorse or promote products derived from this software
161543Srgrimes *    without specific prior written permission.
171543Srgrimes *
181543Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
191543Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
201543Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
211543Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
221543Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
231543Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
241543Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
251543Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
261543Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
271543Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
281543Srgrimes * SUCH DAMAGE.
291543Srgrimes *
301543Srgrimes *	@(#)signal.h	8.1 (Berkeley) 6/11/93
3150477Speter * $FreeBSD$
321543Srgrimes */
331543Srgrimes
349343Sbde#ifndef _MACHINE_SIGNAL_H_
359343Sbde#define	_MACHINE_SIGNAL_H_
362166Spaul
37105014Smike#include <sys/cdefs.h>
38105014Smike#include <sys/_sigset.h>
39105014Smike
401543Srgrimes/*
411543Srgrimes * Machine-dependent signal definitions
421543Srgrimes */
431543Srgrimes
44114349Spetertypedef long sig_atomic_t;
451543Srgrimes
46105014Smike#if __BSD_VISIBLE
471543Srgrimes#include <machine/trap.h>	/* codes for SIGILL, SIGFPE */
481543Srgrimes
491543Srgrimes/*
501543Srgrimes * Information pushed on stack when a signal is delivered.
511543Srgrimes * This is used by the kernel to restore state following
521543Srgrimes * execution of the signal handler.  It is also made available
531543Srgrimes * to the handler to allow it to restore state properly if
541543Srgrimes * a non-standard exit is performed.
55229023Skib *
56229023Skib * The sequence of the fields/registers after sc_mask in struct
57229023Skib * sigcontext must match those in mcontext_t and struct trapframe.
581543Srgrimes */
5983047Sobrienstruct sigcontext {
60105014Smike	struct __sigset sc_mask;	/* signal mask to restore */
61114349Speter	long	sc_onstack;		/* sigstack state to restore */
62119889Speter	long	sc_rdi;		/* machine state (struct trapframe) */
63114349Speter	long	sc_rsi;
64114349Speter	long	sc_rdx;
65114349Speter	long	sc_rcx;
66119889Speter	long	sc_r8;
67119889Speter	long	sc_r9;
68114349Speter	long	sc_rax;
69119889Speter	long	sc_rbx;
70119889Speter	long	sc_rbp;
71119889Speter	long	sc_r10;
72119889Speter	long	sc_r11;
73119889Speter	long	sc_r12;
74119889Speter	long	sc_r13;
75119889Speter	long	sc_r14;
76119889Speter	long	sc_r15;
77190623Skib	int	sc_trapno;
78190623Skib	short	sc_fs;
79190623Skib	short	sc_gs;
80119889Speter	long	sc_addr;
81190623Skib	int	sc_flags;
82190623Skib	short	sc_es;
83190623Skib	short	sc_ds;
84114349Speter	long	sc_err;
85114349Speter	long	sc_rip;
86114349Speter	long	sc_cs;
87114349Speter	long	sc_rflags;
88114349Speter	long	sc_rsp;
89114349Speter	long	sc_ss;
90114349Speter	long	sc_len;			/* sizeof(mcontext_t) */
9153108Smarcel	/*
92229023Skib	 * See <machine/ucontext.h> and <machine/fpu.h> for the following
93229023Skib	 * fields.
9453108Smarcel	 */
95114349Speter	long	sc_fpformat;
96114349Speter	long	sc_ownedfp;
97119888Speter	long	sc_fpstate[64] __aligned(16);
98190623Skib
99190623Skib	long	sc_fsbase;
100190623Skib	long	sc_gsbase;
101190623Skib
102231979Skib	long	sc_xfpustate;
103231979Skib	long	sc_xfpustate_len;
104231979Skib
105231979Skib	long	sc_spare[4];
10651942Smarcel};
107105014Smike#endif /* __BSD_VISIBLE */
1089343Sbde
1099343Sbde#endif /* !_MACHINE_SIGNAL_H_ */
110