1 1.1 maxv /* $NetBSD: freebsd_machdep.h,v 1.1 2017/08/08 08:04:06 maxv Exp $ */ 2 1.1 maxv 3 1.1 maxv /* 4 1.1 maxv * Copyright (c) 1986, 1989, 1991, 1993 5 1.1 maxv * The Regents of the University of California. All rights reserved. 6 1.1 maxv * 7 1.1 maxv * This code is derived from software contributed to Berkeley by 8 1.1 maxv * William Jolitz. 9 1.1 maxv * 10 1.1 maxv * Redistribution and use in source and binary forms, with or without 11 1.1 maxv * modification, are permitted provided that the following conditions 12 1.1 maxv * are met: 13 1.1 maxv * 1. Redistributions of source code must retain the above copyright 14 1.1 maxv * notice, this list of conditions and the following disclaimer. 15 1.1 maxv * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 maxv * notice, this list of conditions and the following disclaimer in the 17 1.1 maxv * documentation and/or other materials provided with the distribution. 18 1.1 maxv * 3. Neither the name of the University nor the names of its contributors 19 1.1 maxv * may be used to endorse or promote products derived from this software 20 1.1 maxv * without specific prior written permission. 21 1.1 maxv * 22 1.1 maxv * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 1.1 maxv * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 1.1 maxv * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 1.1 maxv * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 1.1 maxv * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 1.1 maxv * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 1.1 maxv * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 1.1 maxv * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 1.1 maxv * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 1.1 maxv * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 1.1 maxv * SUCH DAMAGE. 33 1.1 maxv * 34 1.1 maxv * from: @(#)signal.h 8.1 (Berkeley) 6/11/93 35 1.1 maxv * from: Id: signal.h,v 1.4 1994/08/21 04:55:30 paul Exp 36 1.1 maxv * 37 1.1 maxv * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 38 1.1 maxv * from: Id: frame.h,v 1.10 1995/03/16 18:11:42 bde Exp 39 1.1 maxv */ 40 1.1 maxv #ifndef _FREEBSD_MACHDEP_H 41 1.1 maxv #define _FREEBSD_MACHDEP_H 42 1.1 maxv 43 1.1 maxv #include <compat/sys/sigtypes.h> 44 1.1 maxv 45 1.1 maxv /* 46 1.1 maxv * signal support 47 1.1 maxv */ 48 1.1 maxv 49 1.1 maxv struct freebsd_osigcontext { 50 1.1 maxv int sc_onstack; /* sigstack state to restore */ 51 1.1 maxv sigset13_t sc_mask; /* signal mask to restore */ 52 1.1 maxv int sc_esp; /* machine state */ 53 1.1 maxv int sc_ebp; 54 1.1 maxv int sc_isp; 55 1.1 maxv int sc_eip; 56 1.1 maxv int sc_eflags; 57 1.1 maxv int sc_es; 58 1.1 maxv int sc_ds; 59 1.1 maxv int sc_cs; 60 1.1 maxv int sc_ss; 61 1.1 maxv int sc_edi; 62 1.1 maxv int sc_esi; 63 1.1 maxv int sc_ebx; 64 1.1 maxv int sc_edx; 65 1.1 maxv int sc_ecx; 66 1.1 maxv int sc_eax; 67 1.1 maxv }; 68 1.1 maxv 69 1.1 maxv /* 70 1.1 maxv * The sequence of the fields/registers in struct sigcontext should match 71 1.1 maxv * those in mcontext_t. 72 1.1 maxv */ 73 1.1 maxv struct freebsd_sigcontext { 74 1.1 maxv sigset_t sc_mask; /* signal mask to restore */ 75 1.1 maxv int sc_onstack; /* sigstack state to restore */ 76 1.1 maxv int sc_gs; /* machine state (struct trapframe): */ 77 1.1 maxv int sc_fs; 78 1.1 maxv int sc_es; 79 1.1 maxv int sc_ds; 80 1.1 maxv int sc_edi; 81 1.1 maxv int sc_esi; 82 1.1 maxv int sc_ebp; 83 1.1 maxv int sc_isp; 84 1.1 maxv int sc_ebx; 85 1.1 maxv int sc_edx; 86 1.1 maxv int sc_ecx; 87 1.1 maxv int sc_eax; 88 1.1 maxv int sc_trapno; 89 1.1 maxv int sc_err; 90 1.1 maxv int sc_eip; 91 1.1 maxv int sc_cs; 92 1.1 maxv int sc_efl; 93 1.1 maxv int sc_esp; 94 1.1 maxv int sc_ss; 95 1.1 maxv /* 96 1.1 maxv * XXX FPU state is 27 * 4 bytes h/w, 1 * 4 bytes s/w (probably not 97 1.1 maxv * needed here), or that + 16 * 4 bytes for emulators (probably all 98 1.1 maxv * needed here). The "spare" bytes are mostly not spare. 99 1.1 maxv */ 100 1.1 maxv int sc_fpregs[28]; /* machine state (FPU): */ 101 1.1 maxv int sc_spare[17]; 102 1.1 maxv }; 103 1.1 maxv 104 1.1 maxv struct freebsd_sigframe { 105 1.1 maxv int sf_signum; 106 1.1 maxv int sf_code; 107 1.1 maxv struct freebsd_sigcontext *sf_scp; 108 1.1 maxv char *sf_addr; 109 1.1 maxv sig_t sf_handler; 110 1.1 maxv struct freebsd_sigcontext sf_sc; 111 1.1 maxv }; 112 1.1 maxv 113 1.1 maxv void freebsd_syscall_intern(struct proc *); 114 1.1 maxv 115 1.1 maxv #endif /* _FREEBSD_MACHDEP_H */ 116