linux32_signal.h revision 1.4 1 1.4 christos /* $NetBSD: linux32_signal.h,v 1.4 2015/03/08 17:10:44 christos Exp $ */
2 1.1 manu
3 1.1 manu /*-
4 1.1 manu * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
5 1.1 manu *
6 1.1 manu * Redistribution and use in source and binary forms, with or without
7 1.1 manu * modification, are permitted provided that the following conditions
8 1.1 manu * are met:
9 1.1 manu * 1. Redistributions of source code must retain the above copyright
10 1.1 manu * notice, this list of conditions and the following disclaimer.
11 1.1 manu * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 manu * notice, this list of conditions and the following disclaimer in the
13 1.1 manu * documentation and/or other materials provided with the distribution.
14 1.1 manu * 3. All advertising materials mentioning features or use of this software
15 1.1 manu * must display the following acknowledgement:
16 1.1 manu * This product includes software developed by Emmanuel Dreyfus
17 1.1 manu * 4. The name of the author may not be used to endorse or promote
18 1.1 manu * products derived from this software without specific prior written
19 1.1 manu * permission.
20 1.1 manu *
21 1.1 manu * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS''
22 1.1 manu * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 1.1 manu * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 1.1 manu * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
25 1.1 manu * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 1.1 manu * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 1.1 manu * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 1.1 manu * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 1.1 manu * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 1.1 manu * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 1.1 manu * POSSIBILITY OF SUCH DAMAGE.
32 1.1 manu */
33 1.2 njoly #ifndef _AMD64_LINUX32_SIGNAL_H_
34 1.2 njoly #define _AMD64_LINUX32_SIGNAL_H_
35 1.1 manu
36 1.1 manu #define native_to_linux32_signo native_to_linux_signo
37 1.1 manu #define linux32_to_native_signo linux_to_native_signo
38 1.1 manu
39 1.4 christos typedef netbsd32_pointer_t linux32_handlerp_t;
40 1.1 manu typedef netbsd32_pointer_t linux32_restorer_t;
41 1.1 manu typedef netbsd32_pointer_t linux32_siginfop_t;
42 1.1 manu typedef netbsd32_pointer_t linux32_ucontextp_t;
43 1.1 manu typedef netbsd32_pointer_t linux32_sigcontextp_t;
44 1.1 manu typedef netbsd32_pointer_t linux32_fpstatep_t;
45 1.1 manu typedef u_int32_t linux32_old_sigset_t;
46 1.1 manu
47 1.1 manu #define LINUX32__NSIG 64
48 1.1 manu #define LINUX32__NSIG_BPW 32
49 1.1 manu #define LINUX32__NSIG_WORDS (LINUX32__NSIG / LINUX32__NSIG_BPW)
50 1.1 manu
51 1.1 manu #define LINUX32_SIG_BLOCK 0
52 1.1 manu #define LINUX32_SIG_UNBLOCK 1
53 1.1 manu #define LINUX32_SIG_SETMASK 2
54 1.1 manu
55 1.1 manu #define LINUX32_SA_NOCLDSTOP 0x00000001
56 1.1 manu #define LINUX32_SA_NOCLDWAIT 0x00000002
57 1.1 manu #define LINUX32_SA_SIGINFO 0x00000004
58 1.1 manu #define LINUX32_SA_RESTORER 0x04000000
59 1.1 manu #define LINUX32_SA_ONSTACK 0x08000000
60 1.1 manu #define LINUX32_SA_RESTART 0x10000000
61 1.1 manu #define LINUX32_SA_INTERRUPT 0x20000000
62 1.1 manu #define LINUX32_SA_NOMASK 0x40000000
63 1.1 manu #define LINUX32_SA_ONESHOT 0x80000000
64 1.1 manu #define LINUX32_SA_ALLBITS 0xfc000007
65 1.1 manu
66 1.1 manu #define LINUX32_SS_ONSTACK 1
67 1.1 manu #define LINUX32_SS_DISABLE 2
68 1.1 manu
69 1.1 manu /*
70 1.1 manu * We only define the ones used in linux32_machdep.c, since they are
71 1.1 manu * the same on i386 and amd64...
72 1.1 manu */
73 1.1 manu #define LINUX32_SIGILL LINUX_SIGILL
74 1.1 manu #define LINUX32_SIGFPE LINUX_SIGFPE
75 1.1 manu #define LINUX32_SIGSEGV LINUX_SIGSEGV
76 1.1 manu #define LINUX32_SIGBUS LINUX_SIGBUS
77 1.1 manu #define LINUX32_SIGTRAP LINUX_SIGTRAP
78 1.1 manu #define LINUX32_SIGCHLD LINUX_SIGCHLD
79 1.1 manu #define LINUX32_SIGIO LINUX_SIGIO
80 1.1 manu #define LINUX32_SIGALRM LINUX_SIGALRM
81 1.1 manu #define LINUX32_SIGRTMIN LINUX_SIGRTMIN
82 1.1 manu
83 1.1 manu typedef struct {
84 1.1 manu u_int32_t sig[LINUX32__NSIG_WORDS];
85 1.1 manu } linux32_sigset_t;
86 1.1 manu
87 1.1 manu struct linux32_sigaction {
88 1.4 christos linux32_handlerp_t linux_sa_handler;
89 1.1 manu u_int32_t linux_sa_flags;
90 1.1 manu linux32_restorer_t linux_sa_restorer;
91 1.1 manu linux32_sigset_t linux_sa_mask;
92 1.1 manu };
93 1.1 manu
94 1.1 manu
95 1.1 manu struct linux32_sigaltstack {
96 1.1 manu netbsd32_voidp ss_sp;
97 1.1 manu int ss_flags;
98 1.1 manu netbsd32_size_t ss_size;
99 1.1 manu };
100 1.1 manu
101 1.1 manu struct linux32_sigcontext {
102 1.1 manu int sc_gs;
103 1.1 manu int sc_fs;
104 1.1 manu int sc_es;
105 1.1 manu int sc_ds;
106 1.1 manu int sc_edi;
107 1.1 manu int sc_esi;
108 1.1 manu int sc_ebp;
109 1.1 manu int sc_esp;
110 1.1 manu int sc_ebx;
111 1.1 manu int sc_edx;
112 1.1 manu int sc_ecx;
113 1.1 manu int sc_eax;
114 1.1 manu int sc_trapno;
115 1.1 manu int sc_err;
116 1.1 manu int sc_eip;
117 1.1 manu int sc_cs;
118 1.1 manu int sc_eflags;
119 1.1 manu int sc_esp_at_signal;
120 1.1 manu int sc_ss;
121 1.1 manu linux32_fpstatep_t sc_387;
122 1.1 manu /* XXX check this */
123 1.1 manu linux32_old_sigset_t sc_mask;
124 1.1 manu int sc_cr2;
125 1.1 manu };
126 1.1 manu
127 1.1 manu struct linux32_libc_fpreg {
128 1.1 manu unsigned short significand[4];
129 1.1 manu unsigned short exponent;
130 1.1 manu };
131 1.1 manu
132 1.1 manu struct linux32_libc_fpstate {
133 1.1 manu u_int32_t cw;
134 1.1 manu u_int32_t sw;
135 1.1 manu u_int32_t tag;
136 1.1 manu u_int32_t ipoff;
137 1.1 manu u_int32_t cssel;
138 1.1 manu u_int32_t dataoff;
139 1.1 manu u_int32_t datasel;
140 1.1 manu struct linux32_libc_fpreg _st[8];
141 1.1 manu u_int32_t status;
142 1.1 manu };
143 1.1 manu
144 1.1 manu struct linux32_ucontext {
145 1.1 manu u_int32_t uc_flags;
146 1.1 manu linux32_ucontextp_t uc_link;
147 1.1 manu struct linux32_sigaltstack uc_stack;
148 1.1 manu struct linux32_sigcontext uc_mcontext;
149 1.1 manu linux32_sigset_t uc_sigmask;
150 1.1 manu struct linux32_libc_fpstate uc_fpregs_mem;
151 1.1 manu };
152 1.1 manu
153 1.1 manu struct linux32_rt_sigframe {
154 1.1 manu int sf_sig;
155 1.1 manu linux32_siginfop_t sf_sip;
156 1.1 manu linux32_ucontextp_t sf_ucp;
157 1.1 manu struct linux32_siginfo sf_si;
158 1.1 manu struct linux32_ucontext sf_uc;
159 1.4 christos linux32_handlerp_t sf_handler;
160 1.1 manu };
161 1.1 manu
162 1.1 manu struct linux32_sigframe {
163 1.1 manu int sf_sig;
164 1.1 manu struct linux32_sigcontext sf_sc;
165 1.4 christos linux32_handlerp_t sf_handler;
166 1.1 manu };
167 1.1 manu
168 1.2 njoly #endif /* _AMD64_LINUX32_SIGNAL_H_ */
169