1/*- 2 * Copyright (c) 1999 Marcel Moolenaar 3 * Copyright (c) 2003 Peter Wemm 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer 11 * in this position and unchanged. 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. The name of the author may not be used to endorse or promote products 16 * derived from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 *
| 1/*- 2 * Copyright (c) 1999 Marcel Moolenaar 3 * Copyright (c) 2003 Peter Wemm 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer 11 * in this position and unchanged. 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. The name of the author may not be used to endorse or promote products 16 * derived from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 *
|
32struct ia32_mcontext { 33 u_int32_t mc_onstack; /* XXX - sigcontext compat. */ 34 u_int32_t mc_gs; /* machine state (struct trapframe) */ 35 u_int32_t mc_fs; 36 u_int32_t mc_es; 37 u_int32_t mc_ds; 38 u_int32_t mc_edi; 39 u_int32_t mc_esi; 40 u_int32_t mc_ebp; 41 u_int32_t mc_isp; 42 u_int32_t mc_ebx; 43 u_int32_t mc_edx; 44 u_int32_t mc_ecx; 45 u_int32_t mc_eax; 46 u_int32_t mc_trapno; 47 u_int32_t mc_err; 48 u_int32_t mc_eip; 49 u_int32_t mc_cs; 50 u_int32_t mc_eflags; 51 u_int32_t mc_esp; 52 u_int32_t mc_ss; 53 u_int32_t mc_len; /* sizeof(struct ia32_mcontext) */ 54 /* We use the same values for fpformat and ownedfp */ 55 u_int32_t mc_fpformat; 56 u_int32_t mc_ownedfp; 57 u_int32_t mc_spare1[1]; /* align next field to 16 bytes */ 58 /* 59 * See <i386/include/npx.h> for the internals of mc_fpstate[]. 60 */ 61 u_int32_t mc_fpstate[128] __aligned(16); 62 u_int32_t mc_fsbase; 63 u_int32_t mc_gsbase; 64 u_int32_t mc_spare2[6]; 65}; 66 67struct ia32_ucontext { 68 sigset_t uc_sigmask; 69 struct ia32_mcontext uc_mcontext; 70 u_int32_t uc_link; 71 struct sigaltstack32 uc_stack; 72 u_int32_t uc_flags; 73 u_int32_t __spare__[4]; 74}; 75 76 77#if defined(COMPAT_FREEBSD4) 78struct ia32_mcontext4 { 79 u_int32_t mc_onstack; /* XXX - sigcontext compat. */ 80 u_int32_t mc_gs; /* machine state (struct trapframe) */ 81 u_int32_t mc_fs; 82 u_int32_t mc_es; 83 u_int32_t mc_ds; 84 u_int32_t mc_edi; 85 u_int32_t mc_esi; 86 u_int32_t mc_ebp; 87 u_int32_t mc_isp; 88 u_int32_t mc_ebx; 89 u_int32_t mc_edx; 90 u_int32_t mc_ecx; 91 u_int32_t mc_eax; 92 u_int32_t mc_trapno; 93 u_int32_t mc_err; 94 u_int32_t mc_eip; 95 u_int32_t mc_cs; 96 u_int32_t mc_eflags; 97 u_int32_t mc_esp; 98 u_int32_t mc_ss; 99 u_int32_t mc_fpregs[28]; 100 u_int32_t __spare__[17]; 101}; 102 103struct ia32_ucontext4 { 104 sigset_t uc_sigmask; 105 struct ia32_mcontext4 uc_mcontext; 106 u_int32_t uc_link; 107 struct sigaltstack32 uc_stack; 108 u_int32_t __spare__[8]; 109}; 110#endif 111 112#ifdef COMPAT_FREEBSD3 113struct ia32_sigcontext3 { 114 u_int32_t sc_onstack; 115 u_int32_t sc_mask; 116 u_int32_t sc_esp; 117 u_int32_t sc_ebp; 118 u_int32_t sc_isp; 119 u_int32_t sc_eip; 120 u_int32_t sc_eflags; 121 u_int32_t sc_es; 122 u_int32_t sc_ds; 123 u_int32_t sc_cs; 124 u_int32_t sc_ss; 125 u_int32_t sc_edi; 126 u_int32_t sc_esi; 127 u_int32_t sc_ebx; 128 u_int32_t sc_edx; 129 u_int32_t sc_ecx; 130 u_int32_t sc_eax; 131 u_int32_t sc_gs; 132 u_int32_t sc_fs; 133 u_int32_t sc_trapno; 134 u_int32_t sc_err; 135}; 136#endif 137 138/* 139 * Signal frames, arguments passed to application signal handlers. 140 */ 141 142#ifdef COMPAT_FREEBSD4 143struct ia32_sigframe4 { 144 u_int32_t sf_signum; 145 u_int32_t sf_siginfo; /* code or pointer to sf_si */ 146 u_int32_t sf_ucontext; /* points to sf_uc */ 147 u_int32_t sf_addr; /* undocumented 4th arg */ 148 u_int32_t sf_ah; /* action/handler pointer */ 149 struct ia32_ucontext4 sf_uc; /* = *sf_ucontext */ 150 struct siginfo32 sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ 151}; 152#endif 153 154struct ia32_sigframe { 155 u_int32_t sf_signum; 156 u_int32_t sf_siginfo; /* code or pointer to sf_si */ 157 u_int32_t sf_ucontext; /* points to sf_uc */ 158 u_int32_t sf_addr; /* undocumented 4th arg */ 159 u_int32_t sf_ah; /* action/handler pointer */ 160 /* Beware, hole due to ucontext being 16 byte aligned! */ 161 struct ia32_ucontext sf_uc; /* = *sf_ucontext */ 162 struct siginfo32 sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ 163}; 164 165#ifdef COMPAT_FREEBSD3 166struct ia32_siginfo3 { 167 struct ia32_sigcontext3 si_sc; 168 int si_signo; 169 int si_code; 170 union sigval32 si_value; 171}; 172struct ia32_sigframe3 { 173 int sf_signum; 174 u_int32_t sf_arg2; /* int or siginfo_t */ 175 u_int32_t sf_scp; 176 u_int32_t sf_addr; 177 u_int32_t sf_ah; /* action/handler pointer */ 178 struct ia32_siginfo3 sf_siginfo; 179}; 180#endif 181 182struct ksiginfo; 183struct image_params; 184extern char ia32_sigcode[]; 185extern char freebsd4_ia32_sigcode[]; 186extern int sz_ia32_sigcode; 187extern int sz_freebsd4_ia32_sigcode; 188extern void ia32_sendsig(sig_t, struct ksiginfo *, sigset_t *); 189extern void ia32_setregs(struct thread *td, struct image_params *imgp, 190 u_long stack);
| 35struct ia32_mcontext { 36 u_int32_t mc_onstack; /* XXX - sigcontext compat. */ 37 u_int32_t mc_gs; /* machine state (struct trapframe) */ 38 u_int32_t mc_fs; 39 u_int32_t mc_es; 40 u_int32_t mc_ds; 41 u_int32_t mc_edi; 42 u_int32_t mc_esi; 43 u_int32_t mc_ebp; 44 u_int32_t mc_isp; 45 u_int32_t mc_ebx; 46 u_int32_t mc_edx; 47 u_int32_t mc_ecx; 48 u_int32_t mc_eax; 49 u_int32_t mc_trapno; 50 u_int32_t mc_err; 51 u_int32_t mc_eip; 52 u_int32_t mc_cs; 53 u_int32_t mc_eflags; 54 u_int32_t mc_esp; 55 u_int32_t mc_ss; 56 u_int32_t mc_len; /* sizeof(struct ia32_mcontext) */ 57 /* We use the same values for fpformat and ownedfp */ 58 u_int32_t mc_fpformat; 59 u_int32_t mc_ownedfp; 60 u_int32_t mc_spare1[1]; /* align next field to 16 bytes */ 61 /* 62 * See <i386/include/npx.h> for the internals of mc_fpstate[]. 63 */ 64 u_int32_t mc_fpstate[128] __aligned(16); 65 u_int32_t mc_fsbase; 66 u_int32_t mc_gsbase; 67 u_int32_t mc_spare2[6]; 68}; 69 70struct ia32_ucontext { 71 sigset_t uc_sigmask; 72 struct ia32_mcontext uc_mcontext; 73 u_int32_t uc_link; 74 struct sigaltstack32 uc_stack; 75 u_int32_t uc_flags; 76 u_int32_t __spare__[4]; 77}; 78 79 80#if defined(COMPAT_FREEBSD4) 81struct ia32_mcontext4 { 82 u_int32_t mc_onstack; /* XXX - sigcontext compat. */ 83 u_int32_t mc_gs; /* machine state (struct trapframe) */ 84 u_int32_t mc_fs; 85 u_int32_t mc_es; 86 u_int32_t mc_ds; 87 u_int32_t mc_edi; 88 u_int32_t mc_esi; 89 u_int32_t mc_ebp; 90 u_int32_t mc_isp; 91 u_int32_t mc_ebx; 92 u_int32_t mc_edx; 93 u_int32_t mc_ecx; 94 u_int32_t mc_eax; 95 u_int32_t mc_trapno; 96 u_int32_t mc_err; 97 u_int32_t mc_eip; 98 u_int32_t mc_cs; 99 u_int32_t mc_eflags; 100 u_int32_t mc_esp; 101 u_int32_t mc_ss; 102 u_int32_t mc_fpregs[28]; 103 u_int32_t __spare__[17]; 104}; 105 106struct ia32_ucontext4 { 107 sigset_t uc_sigmask; 108 struct ia32_mcontext4 uc_mcontext; 109 u_int32_t uc_link; 110 struct sigaltstack32 uc_stack; 111 u_int32_t __spare__[8]; 112}; 113#endif 114 115#ifdef COMPAT_FREEBSD3 116struct ia32_sigcontext3 { 117 u_int32_t sc_onstack; 118 u_int32_t sc_mask; 119 u_int32_t sc_esp; 120 u_int32_t sc_ebp; 121 u_int32_t sc_isp; 122 u_int32_t sc_eip; 123 u_int32_t sc_eflags; 124 u_int32_t sc_es; 125 u_int32_t sc_ds; 126 u_int32_t sc_cs; 127 u_int32_t sc_ss; 128 u_int32_t sc_edi; 129 u_int32_t sc_esi; 130 u_int32_t sc_ebx; 131 u_int32_t sc_edx; 132 u_int32_t sc_ecx; 133 u_int32_t sc_eax; 134 u_int32_t sc_gs; 135 u_int32_t sc_fs; 136 u_int32_t sc_trapno; 137 u_int32_t sc_err; 138}; 139#endif 140 141/* 142 * Signal frames, arguments passed to application signal handlers. 143 */ 144 145#ifdef COMPAT_FREEBSD4 146struct ia32_sigframe4 { 147 u_int32_t sf_signum; 148 u_int32_t sf_siginfo; /* code or pointer to sf_si */ 149 u_int32_t sf_ucontext; /* points to sf_uc */ 150 u_int32_t sf_addr; /* undocumented 4th arg */ 151 u_int32_t sf_ah; /* action/handler pointer */ 152 struct ia32_ucontext4 sf_uc; /* = *sf_ucontext */ 153 struct siginfo32 sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ 154}; 155#endif 156 157struct ia32_sigframe { 158 u_int32_t sf_signum; 159 u_int32_t sf_siginfo; /* code or pointer to sf_si */ 160 u_int32_t sf_ucontext; /* points to sf_uc */ 161 u_int32_t sf_addr; /* undocumented 4th arg */ 162 u_int32_t sf_ah; /* action/handler pointer */ 163 /* Beware, hole due to ucontext being 16 byte aligned! */ 164 struct ia32_ucontext sf_uc; /* = *sf_ucontext */ 165 struct siginfo32 sf_si; /* = *sf_siginfo (SA_SIGINFO case) */ 166}; 167 168#ifdef COMPAT_FREEBSD3 169struct ia32_siginfo3 { 170 struct ia32_sigcontext3 si_sc; 171 int si_signo; 172 int si_code; 173 union sigval32 si_value; 174}; 175struct ia32_sigframe3 { 176 int sf_signum; 177 u_int32_t sf_arg2; /* int or siginfo_t */ 178 u_int32_t sf_scp; 179 u_int32_t sf_addr; 180 u_int32_t sf_ah; /* action/handler pointer */ 181 struct ia32_siginfo3 sf_siginfo; 182}; 183#endif 184 185struct ksiginfo; 186struct image_params; 187extern char ia32_sigcode[]; 188extern char freebsd4_ia32_sigcode[]; 189extern int sz_ia32_sigcode; 190extern int sz_freebsd4_ia32_sigcode; 191extern void ia32_sendsig(sig_t, struct ksiginfo *, sigset_t *); 192extern void ia32_setregs(struct thread *td, struct image_params *imgp, 193 u_long stack);
|