installer: Finish incomplete commit to merge nrelease/{installer,root}.
[dragonfly.git] / sys / cpu / amd64 / include / signal.h
1 /*
2  * Copyright (c) 1986, 1989, 1991, 1993
3  *      The Regents of the University of California.
4  * Copyright (c) 2008 The DragonFly Project.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *      This product includes software developed by the University of
18  *      California, Berkeley and its contributors.
19  * 4. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  *      @(#)signal.h    8.1 (Berkeley) 6/11/93
36  * $FreeBSD: src/sys/i386/include/signal.h,v 1.12 1999/11/12 13:52:11 marcel Exp $
37  * $DragonFly: src/sys/cpu/amd64/include/signal.h,v 1.3 2008/08/29 17:07:06 dillon Exp $
38  */
39
40 #ifndef _CPU_SIGNAL_H_
41 #define _CPU_SIGNAL_H_
42
43 /** si_code **/
44 /* codes for SIGILL */
45 #define ILL_ILLOPC      1       /* Illegal opcode.                      */
46 #define ILL_ILLOPN      2       /* Illegal operand.                     */
47 #define ILL_ILLADR      3       /* Illegal addressing mode.             */
48 #define ILL_ILLTRP      4       /* Illegal trap.                        */
49 #define ILL_PRVOPC      5       /* Privileged opcode.                   */
50 #define ILL_PRVREG      6       /* Privileged register.                 */
51 #define ILL_COPROC      7       /* Coprocessor error.                   */
52 #define ILL_BADSTK      8       /* Internal stack error.                */
53
54 /* codes for SIGBUS */
55 #define BUS_ADRALN      1       /* Invalid address alignment.           */
56 #define BUS_ADRERR      2       /* Nonexistent physical address.        */
57 #define BUS_OBJERR      3       /* Object-specific hardware error.      */
58
59 /* codes for SIGSEGV */
60 #define SEGV_MAPERR     1       /* Address not mapped to object.        */
61 #define SEGV_ACCERR     2       /* Invalid permissions for mapped       */
62                                 /* object.                              */
63
64 /* codes for SIGFPE */
65 #define FPE_INTOVF      1       /* Integer overflow.                    */
66 #define FPE_INTDIV      2       /* Integer divide by zero.              */
67 #define FPE_FLTDIV      3       /* Floating point divide by zero.       */
68 #define FPE_FLTOVF      4       /* Floating point overflow.             */
69 #define FPE_FLTUND      5       /* Floating point underflow.            */
70 #define FPE_FLTRES      6       /* Floating point inexact result.       */
71 #define FPE_FLTINV      7       /* Invalid floating point operation.    */
72 #define FPE_FLTSUB      8       /* Subscript out of range.              */
73
74 /* codes for SIGTRAP */
75 #define TRAP_BRKPT      1       /* Process breakpoint.                  */
76 #define TRAP_TRACE      2       /* Process trace trap.                  */
77
78 /* codes for SIGCHLD */
79 #define CLD_EXITED      1       /* Child has exited                     */
80 #define CLD_KILLED      2       /* Child has terminated abnormally but  */
81                                 /* did not create a core file           */
82 #define CLD_DUMPED      3       /* Child has terminated abnormally and  */
83                                 /* created a core file                  */
84 #define CLD_TRAPPED     4       /* Traced child has trapped             */
85 #define CLD_STOPPED     5       /* Child has stopped                    */
86 #define CLD_CONTINUED   6       /* Stopped child has continued          */
87
88 /* codes for SIGPOLL */
89 #define POLL_IN         1       /* Data input available                 */
90 #define POLL_OUT        2       /* Output buffers available             */
91 #define POLL_MSG        3       /* Input message available              */
92 #define POLL_ERR        4       /* I/O Error                            */
93 #define POLL_PRI        5       /* High priority input available        */
94 #define POLL_HUP        4       /* Device disconnected                  */
95
96 /*
97  * Machine-dependent signal definitions
98  */
99
100 typedef int sig_atomic_t;
101
102 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
103
104 #include <machine/trap.h>       /* codes for SIGILL, SIGFPE */
105
106 /*
107  * Information pushed on stack when a signal is delivered.
108  * This is used by the kernel to restore state following
109  * execution of the signal handler.  It is also made available
110  * to the handler to allow it to restore state properly if
111  * a non-standard exit is performed.
112  *
113  * The sequence of the fields/registers in struct sigcontext should match
114  * those in mcontext_t.
115  */
116 struct  sigcontext {
117         sigset_t        sc_mask;        /* signal mask to restore */
118
119         long            sc_onstack;     /* sigstack state to restore */
120         long            sc_rdi;
121         long            sc_rsi;
122         long            sc_rdx;
123         long            sc_rcx;
124         long            sc_r8;
125         long            sc_r9;
126         long            sc_rax;
127         long            sc_rbx;
128         long            sc_rbp;
129         long            sc_r10;
130         long            sc_r11;
131         long            sc_r12;
132         long            sc_r13;
133         long            sc_r14;
134         long            sc_r15;
135         long            sc_xflags;
136         long            sc_trapno;
137         long            sc_addr;
138         long            sc_flags;
139         long            sc_err;
140         long            sc_rip;
141         long            sc_cs;
142         long            sc_rflags;
143         long            sc_rsp;
144         long            sc_ss;
145
146         unsigned int    sc_len;
147         unsigned int    sc_fpformat;
148         unsigned int    sc_ownedfp;
149         unsigned int    sc_reserved;
150         unsigned int    sc_unused01;
151         unsigned int    sc_unused02;
152
153         /* 16 byte aligned */
154
155         int             sc_fpregs[128];
156         int             __spare__[16];
157 };
158
159 #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
160
161 #endif /* !_CPU_SIGNAL_H_ */