rename amd64 architecture to x86_64
[dragonfly.git] / sys / cpu / x86_64 / 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  */
38
39 #ifndef _CPU_SIGNAL_H_
40 #define _CPU_SIGNAL_H_
41
42 /** si_code **/
43 /* codes for SIGILL */
44 #define ILL_ILLOPC      1       /* Illegal opcode.                      */
45 #define ILL_ILLOPN      2       /* Illegal operand.                     */
46 #define ILL_ILLADR      3       /* Illegal addressing mode.             */
47 #define ILL_ILLTRP      4       /* Illegal trap.                        */
48 #define ILL_PRVOPC      5       /* Privileged opcode.                   */
49 #define ILL_PRVREG      6       /* Privileged register.                 */
50 #define ILL_COPROC      7       /* Coprocessor error.                   */
51 #define ILL_BADSTK      8       /* Internal stack error.                */
52
53 /* codes for SIGBUS */
54 #define BUS_ADRALN      1       /* Invalid address alignment.           */
55 #define BUS_ADRERR      2       /* Nonexistent physical address.        */
56 #define BUS_OBJERR      3       /* Object-specific hardware error.      */
57
58 /* codes for SIGSEGV */
59 #define SEGV_MAPERR     1       /* Address not mapped to object.        */
60 #define SEGV_ACCERR     2       /* Invalid permissions for mapped       */
61                                 /* object.                              */
62
63 /* codes for SIGFPE */
64 #define FPE_INTOVF      1       /* Integer overflow.                    */
65 #define FPE_INTDIV      2       /* Integer divide by zero.              */
66 #define FPE_FLTDIV      3       /* Floating point divide by zero.       */
67 #define FPE_FLTOVF      4       /* Floating point overflow.             */
68 #define FPE_FLTUND      5       /* Floating point underflow.            */
69 #define FPE_FLTRES      6       /* Floating point inexact result.       */
70 #define FPE_FLTINV      7       /* Invalid floating point operation.    */
71 #define FPE_FLTSUB      8       /* Subscript out of range.              */
72
73 /* codes for SIGTRAP */
74 #define TRAP_BRKPT      1       /* Process breakpoint.                  */
75 #define TRAP_TRACE      2       /* Process trace trap.                  */
76
77 /* codes for SIGCHLD */
78 #define CLD_EXITED      1       /* Child has exited                     */
79 #define CLD_KILLED      2       /* Child has terminated abnormally but  */
80                                 /* did not create a core file           */
81 #define CLD_DUMPED      3       /* Child has terminated abnormally and  */
82                                 /* created a core file                  */
83 #define CLD_TRAPPED     4       /* Traced child has trapped             */
84 #define CLD_STOPPED     5       /* Child has stopped                    */
85 #define CLD_CONTINUED   6       /* Stopped child has continued          */
86
87 /* codes for SIGPOLL */
88 #define POLL_IN         1       /* Data input available                 */
89 #define POLL_OUT        2       /* Output buffers available             */
90 #define POLL_MSG        3       /* Input message available              */
91 #define POLL_ERR        4       /* I/O Error                            */
92 #define POLL_PRI        5       /* High priority input available        */
93 #define POLL_HUP        4       /* Device disconnected                  */
94
95 /*
96  * Machine-dependent signal definitions
97  */
98
99 typedef int sig_atomic_t;
100
101 #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
102
103 #include <machine/trap.h>       /* codes for SIGILL, SIGFPE */
104
105 /*
106  * Information pushed on stack when a signal is delivered.
107  * This is used by the kernel to restore state following
108  * execution of the signal handler.  It is also made available
109  * to the handler to allow it to restore state properly if
110  * a non-standard exit is performed.
111  *
112  * The sequence of the fields/registers in struct sigcontext should match
113  * those in mcontext_t.
114  */
115 struct  sigcontext {
116         sigset_t        sc_mask;        /* signal mask to restore */
117
118         long            sc_onstack;     /* sigstack state to restore */
119         long            sc_rdi;
120         long            sc_rsi;
121         long            sc_rdx;
122         long            sc_rcx;
123         long            sc_r8;
124         long            sc_r9;
125         long            sc_rax;
126         long            sc_rbx;
127         long            sc_rbp;
128         long            sc_r10;
129         long            sc_r11;
130         long            sc_r12;
131         long            sc_r13;
132         long            sc_r14;
133         long            sc_r15;
134         long            sc_xflags;
135         long            sc_trapno;
136         long            sc_addr;
137         long            sc_flags;
138         long            sc_err;
139         long            sc_rip;
140         long            sc_cs;
141         long            sc_rflags;
142         long            sc_rsp;
143         long            sc_ss;
144
145         unsigned int    sc_len;
146         unsigned int    sc_fpformat;
147         unsigned int    sc_ownedfp;
148         unsigned int    sc_reserved;
149         unsigned int    sc_unused01;
150         unsigned int    sc_unused02;
151
152         /* 16 byte aligned */
153
154         int             sc_fpregs[128];
155         int             __spare__[16];
156 };
157
158 #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
159
160 #endif /* !_CPU_SIGNAL_H_ */