diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-05 12:50:16 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-04-05 12:50:16 +0000 |
commit | b2b6c7a9063c88d92da6ab79d2e1ffd7ac133576 (patch) | |
tree | de9b11224cdbee08151570d48396b881c74c831c /sys/arch | |
parent | f3217e0943161ff8510a20c5604474e66e68adea (diff) |
Push COMPAT_FREEBSD in front of a whale. Buggy, out of date, no
one has been weeding it, and it makes life harder.
Toasts of Brennivin for its passing from many; diff ok henning@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/arch/i386/conf/files.i386 | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/freebsd_machdep.c | 395 | ||||
-rw-r--r-- | sys/arch/i386/i386/genassym.cf | 13 | ||||
-rw-r--r-- | sys/arch/i386/i386/locore.s | 25 | ||||
-rw-r--r-- | sys/arch/i386/i386/trap.c | 9 | ||||
-rw-r--r-- | sys/arch/i386/include/freebsd_machdep.h | 161 |
7 files changed, 5 insertions, 607 deletions
diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC index f746cb75a06..e8def23c189 100644 --- a/sys/arch/i386/conf/GENERIC +++ b/sys/arch/i386/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.711 2011/04/03 12:32:05 claudio Exp $ +# $OpenBSD: GENERIC,v 1.712 2011/04/05 12:50:15 guenther Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -25,7 +25,6 @@ option APERTURE # in-kernel aperture driver for XFree86 option COMPAT_SVR4 # binary compatibility with SVR4 option COMPAT_LINUX # binary compatibility with Linux -option COMPAT_FREEBSD # binary compatibility with FreeBSD option COMPAT_AOUT # a.out binaries are emulated option PROCFS # /proc diff --git a/sys/arch/i386/conf/files.i386 b/sys/arch/i386/conf/files.i386 index c67da345d4e..cadf84b36fa 100644 --- a/sys/arch/i386/conf/files.i386 +++ b/sys/arch/i386/conf/files.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: files.i386,v 1.200 2010/12/06 20:10:18 jasper Exp $ +# $OpenBSD: files.i386,v 1.201 2011/04/05 12:50:15 guenther Exp $ # # new style config file for i386 architecture # @@ -278,10 +278,6 @@ file arch/i386/i386/svr4_machdep.c compat_svr4 include "compat/linux/files.linux" file arch/i386/i386/linux_machdep.c compat_linux -# FreeBSD binary compatibility (COMPAT_FREEBSD) -include "compat/freebsd/files.freebsd" -file arch/i386/i386/freebsd_machdep.c compat_freebsd - # OSS audio driver compatibility include "compat/ossaudio/files.ossaudio" diff --git a/sys/arch/i386/i386/freebsd_machdep.c b/sys/arch/i386/i386/freebsd_machdep.c deleted file mode 100644 index 43d4f849238..00000000000 --- a/sys/arch/i386/i386/freebsd_machdep.c +++ /dev/null @@ -1,395 +0,0 @@ -/* $OpenBSD: freebsd_machdep.c,v 1.22 2008/03/18 14:29:25 kettenis Exp $ */ -/* $NetBSD: freebsd_machdep.c,v 1.10 1996/05/03 19:42:05 christos Exp $ */ - -/*- - * Copyright (c) 1993, 1994, 1995, 1996 Charles M. Hannum. All rights reserved. - * Copyright (c) 1992 Terrence R. Lambert. - * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)machdep.c 7.4 (Berkeley) 6/3/91 - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/signalvar.h> -#include <sys/proc.h> -#include <sys/user.h> -#include <sys/exec.h> -#include <sys/mount.h> - -#include <uvm/uvm_extern.h> - -#include <machine/cpufunc.h> -#include <machine/npx.h> -#include <machine/reg.h> -#include <machine/vm86.h> -#include <machine/freebsd_machdep.h> - -#include <compat/freebsd/freebsd_signal.h> -#include <compat/freebsd/freebsd_syscallargs.h> -#include <compat/freebsd/freebsd_exec.h> -#include <compat/freebsd/freebsd_ptrace.h> - -/* - * signal support - */ - -/* - * Send an interrupt to process. - * - * Stack is set up to allow sigcode stored - * in u. to call routine, followed by kcall - * to sigreturn routine below. After sigreturn - * resets the signal mask, the stack, and the - * frame pointer, it returns to the user - * specified pc, psl. - */ -void -freebsd_sendsig(sig_t catcher, int sig, int mask, u_long code, int type, - union sigval val) -{ - struct proc *p = curproc; - struct trapframe *tf; - struct freebsd_sigframe *fp, frame; - struct sigacts *psp = p->p_sigacts; - int oonstack; - - /* - * Build the argument list for the signal handler. - */ - frame.sf_signum = sig; - - tf = p->p_md.md_regs; - oonstack = psp->ps_sigstk.ss_flags & SS_ONSTACK; - - /* - * Allocate space for the signal handler context. - */ - if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack && - (psp->ps_sigonstack & sigmask(sig))) { - fp = (struct freebsd_sigframe *)((char *)psp->ps_sigstk.ss_sp + - psp->ps_sigstk.ss_size - sizeof(struct freebsd_sigframe)); - psp->ps_sigstk.ss_flags |= SS_ONSTACK; - } else { - fp = (struct freebsd_sigframe *)tf->tf_esp - 1; - } - - frame.sf_code = code; - frame.sf_scp = &fp->sf_sc; - frame.sf_addr = (char *)rcr2(); - frame.sf_handler = catcher; - - /* - * Build the signal context to be used by sigreturn. - */ - frame.sf_sc.sc_onstack = oonstack; - frame.sf_sc.sc_mask = mask; -#ifdef VM86 - if (tf->tf_eflags & PSL_VM) { - frame.sf_sc.sc_es = tf->tf_vm86_es; - frame.sf_sc.sc_ds = tf->tf_vm86_ds; - frame.sf_sc.sc_eflags = get_vflags(p); - } else -#endif - { - frame.sf_sc.sc_es = tf->tf_es; - frame.sf_sc.sc_ds = tf->tf_ds; - frame.sf_sc.sc_eflags = tf->tf_eflags; - } - frame.sf_sc.sc_edi = tf->tf_edi; - frame.sf_sc.sc_esi = tf->tf_esi; - frame.sf_sc.sc_ebp = tf->tf_ebp; - frame.sf_sc.sc_isp = 0; /* don't have to pass kernel sp to user. */ - frame.sf_sc.sc_ebx = tf->tf_ebx; - frame.sf_sc.sc_edx = tf->tf_edx; - frame.sf_sc.sc_ecx = tf->tf_ecx; - frame.sf_sc.sc_eax = tf->tf_eax; - frame.sf_sc.sc_eip = tf->tf_eip; - frame.sf_sc.sc_cs = tf->tf_cs; - frame.sf_sc.sc_esp = tf->tf_esp; - frame.sf_sc.sc_ss = tf->tf_ss; - - if (copyout(&frame, fp, sizeof(frame)) != 0) { - /* - * Process has trashed its stack; give it an illegal - * instruction to halt it in its tracks. - */ - sigexit(p, SIGILL); - /* NOTREACHED */ - } - - /* - * Build context to run handler in. - */ - tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL); - tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL); - tf->tf_eip = p->p_sigcode; - tf->tf_cs = GSEL(GUCODE_SEL, SEL_UPL); - tf->tf_eflags &= ~(PSL_T|PSL_D|PSL_VM|PSL_AC); - tf->tf_esp = (int)fp; - tf->tf_ss = GSEL(GUDATA_SEL, SEL_UPL); -} - -/* - * System call to cleanup state after a signal - * has been taken. Reset signal mask and - * stack state from context left by sendsig (above). - * Return to previous pc and psl as specified by - * context left by sendsig. Check carefully to - * make sure that the user has not modified the - * psl to gain improper privileges or to cause - * a machine fault. - */ -int -freebsd_sys_sigreturn(struct proc *p, void *v, register_t *retval) -{ - struct freebsd_sys_sigreturn_args /* { - syscallarg(struct freebsd_sigcontext *) scp; - } */ *uap = v; - struct freebsd_sigcontext *scp, context; - struct trapframe *tf; - - tf = p->p_md.md_regs; - - /* - * The trampoline code hands us the context. - * It is unsafe to keep track of it ourselves, in the event that a - * program jumps out of a signal handler. - */ - scp = SCARG(uap, scp); - if (copyin((caddr_t)scp, &context, sizeof(*scp)) != 0) - return (EFAULT); - - /* - * Restore signal context. - */ -#ifdef VM86 - if (context.sc_eflags & PSL_VM) { - tf->tf_vm86_es = context.sc_es; - tf->tf_vm86_ds = context.sc_ds; - set_vflags(p, context.sc_eflags); - } else -#endif - { - /* - * Check for security violations. If we're returning to - * protected mode, the CPU will validate the segment registers - * automatically and generate a trap on violations. We handle - * the trap, rather than doing all of the checking here. - */ - if (((context.sc_eflags ^ tf->tf_eflags) & PSL_USERSTATIC) != 0 || - !USERMODE(context.sc_cs, context.sc_eflags)) - return (EINVAL); - - tf->tf_es = context.sc_es; - tf->tf_ds = context.sc_ds; - tf->tf_eflags = context.sc_eflags; - } - tf->tf_edi = context.sc_edi; - tf->tf_esi = context.sc_esi; - tf->tf_ebp = context.sc_ebp; - /* FreeBSD's context.sc_isp is useless. (`popal' ignores it.) */ - tf->tf_ebx = context.sc_ebx; - tf->tf_edx = context.sc_edx; - tf->tf_ecx = context.sc_ecx; - tf->tf_eax = context.sc_eax; - tf->tf_eip = context.sc_eip; - tf->tf_cs = context.sc_cs; - tf->tf_esp = context.sc_esp; - tf->tf_ss = context.sc_ss; - - if (context.sc_onstack & 01) - p->p_sigacts->ps_sigstk.ss_flags |= SS_ONSTACK; - else - p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK; - p->p_sigmask = context.sc_mask & ~sigcantmask; - - return (EJUSTRETURN); -} - - -/* - * freebsd_ptrace(2) support - */ - -void -netbsd_to_freebsd_ptrace_regs(struct reg *nregs, struct fpreg *nfpregs, - struct freebsd_ptrace_reg *fregs) -{ - struct save87 *nframe = (struct save87 *)nfpregs; - - fregs->freebsd_ptrace_regs.tf_es = nregs->r_es; - fregs->freebsd_ptrace_regs.tf_ds = nregs->r_ds; - fregs->freebsd_ptrace_regs.tf_edi = nregs->r_edi; - fregs->freebsd_ptrace_regs.tf_esi = nregs->r_esi; - fregs->freebsd_ptrace_regs.tf_ebp = nregs->r_ebp; - fregs->freebsd_ptrace_regs.tf_isp = 0; - fregs->freebsd_ptrace_regs.tf_ebx = nregs->r_ebx; - fregs->freebsd_ptrace_regs.tf_edx = nregs->r_edx; - fregs->freebsd_ptrace_regs.tf_ecx = nregs->r_ecx; - fregs->freebsd_ptrace_regs.tf_eax = nregs->r_eax; - fregs->freebsd_ptrace_regs.tf_trapno = 0; - - fregs->freebsd_ptrace_regs.tf_err = 0; - fregs->freebsd_ptrace_regs.tf_eip = nregs->r_eip; - fregs->freebsd_ptrace_regs.tf_cs = nregs->r_cs; - fregs->freebsd_ptrace_regs.tf_eflags = nregs->r_eflags; - - fregs->freebsd_ptrace_regs.tf_esp = nregs->r_esp; - fregs->freebsd_ptrace_regs.tf_ss = nregs->r_ss; - - fregs->freebsd_ptrace_fpregs.sv_env = - *(struct freebsd_env87 *)&nframe->sv_env; - bcopy(nframe->sv_ac, fregs->freebsd_ptrace_fpregs.sv_ac, - sizeof(fregs->freebsd_ptrace_fpregs.sv_ac)); - fregs->freebsd_ptrace_fpregs.sv_ex_sw = - nframe->sv_ex_sw; -#if 0 - /* - * fortunately, sizeof(freebsd_save87) >= sizeof(save87) - */ -#ifdef DIAGNOSTIC - if (sizeof(fregs->freebsd_ptrace_fpregs.sv_pad) < - sizeof(nframe->sv_ex_tw) + sizeof(nframe->sv_pad)) { - panic("netbsd_to_freebsd_ptrace_regs: %s", - "sizeof(freebsd_save87) >= sizeof(save87)"); - } -#endif -#endif - bcopy(&nframe->sv_ex_tw, fregs->freebsd_ptrace_fpregs.sv_pad, - sizeof(nframe->sv_ex_tw)); -#if 0 - bcopy(nframe->sv_pad, - (caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad + - sizeof(nframe->sv_ex_tw), - sizeof(nframe->sv_pad)); - bzero((caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad + - sizeof(nframe->sv_ex_tw) + sizeof(nframe->sv_pad), - sizeof(fregs->freebsd_ptrace_fpregs.sv_pad) - - sizeof(nframe->sv_ex_tw) - sizeof(nframe->sv_pad)); -#endif -} - -void -freebsd_to_netbsd_ptrace_regs(struct freebsd_ptrace_reg *fregs, - struct reg *nregs, struct fpreg *nfpregs) -{ - struct save87 *nframe = (struct save87 *)nfpregs; - - nregs->r_es = fregs->freebsd_ptrace_regs.tf_es; - nregs->r_ds = fregs->freebsd_ptrace_regs.tf_ds; - nregs->r_edi = fregs->freebsd_ptrace_regs.tf_edi; - nregs->r_esi = fregs->freebsd_ptrace_regs.tf_esi; - nregs->r_ebp = fregs->freebsd_ptrace_regs.tf_ebp; - nregs->r_ebx = fregs->freebsd_ptrace_regs.tf_ebx; - nregs->r_edx = fregs->freebsd_ptrace_regs.tf_edx; - nregs->r_ecx = fregs->freebsd_ptrace_regs.tf_ecx; - nregs->r_eax = fregs->freebsd_ptrace_regs.tf_eax; - - nregs->r_eip = fregs->freebsd_ptrace_regs.tf_eip; - nregs->r_cs = fregs->freebsd_ptrace_regs.tf_cs; - nregs->r_eflags = fregs->freebsd_ptrace_regs.tf_eflags; - - nregs->r_esp = fregs->freebsd_ptrace_regs.tf_esp; - nregs->r_ss = fregs->freebsd_ptrace_regs.tf_ss; - - nframe->sv_env = - *(struct env87 *)&fregs->freebsd_ptrace_fpregs.sv_env; - bcopy(fregs->freebsd_ptrace_fpregs.sv_ac, nframe->sv_ac, - sizeof(nframe->sv_ac)); - nframe->sv_ex_sw = - fregs->freebsd_ptrace_fpregs.sv_ex_sw; - /* - * fortunately, sizeof(freebsd_save87) >= sizeof(save87) - */ - bcopy(fregs->freebsd_ptrace_fpregs.sv_pad, &nframe->sv_ex_tw, - sizeof(nframe->sv_ex_tw)); -#if 0 - bcopy((caddr_t)fregs->freebsd_ptrace_fpregs.sv_pad + - sizeof(nframe->sv_ex_tw), - nframe->sv_pad, sizeof(nframe->sv_pad)); -#endif -} - -/* random value, except FREEBSD_U_AR0_OFFSET..., FREEBSD_U_SAVEFP_OFFSET... */ -#define FREEBSD_REGS_OFFSET 0x2000 - -int -freebsd_ptrace_getregs(struct freebsd_ptrace_reg *fregs, caddr_t addr, - register_t *datap) -{ - vaddr_t offset = (vaddr_t)addr; - - if (offset == FREEBSD_U_AR0_OFFSET) { - *datap = FREEBSD_REGS_OFFSET + FREEBSD_USRSTACK; - return 0; - } else if (offset >= FREEBSD_REGS_OFFSET && - offset <= FREEBSD_REGS_OFFSET + - sizeof(fregs->freebsd_ptrace_regs)-sizeof(register_t)) { - *datap = *(register_t *)&((caddr_t)&fregs->freebsd_ptrace_regs) - [(vaddr_t) addr - FREEBSD_REGS_OFFSET]; - return 0; - } else if (offset >= FREEBSD_U_SAVEFP_OFFSET && - offset <= FREEBSD_U_SAVEFP_OFFSET + - sizeof(fregs->freebsd_ptrace_fpregs)-sizeof(register_t)){ - *datap= *(register_t *)&((caddr_t)&fregs->freebsd_ptrace_fpregs) - [offset - FREEBSD_U_SAVEFP_OFFSET]; - return 0; - } -#ifdef DIAGNOSTIC - printf("freebsd_ptrace_getregs: *(0x%08lx)\n", offset); -#endif - return EFAULT; -} - -int -freebsd_ptrace_setregs(struct freebsd_ptrace_reg *fregs, caddr_t addr, int data) -{ - vaddr_t offset = (vaddr_t)addr; - - if (offset >= FREEBSD_REGS_OFFSET && - offset <= FREEBSD_REGS_OFFSET + - sizeof(fregs->freebsd_ptrace_regs) - sizeof(int)) { - *(int *)&((caddr_t)&fregs->freebsd_ptrace_regs) - [offset - FREEBSD_REGS_OFFSET] = data; - return 0; - } else if (offset >= FREEBSD_U_SAVEFP_OFFSET && - offset <= FREEBSD_U_SAVEFP_OFFSET + - sizeof(fregs->freebsd_ptrace_fpregs) - sizeof(int)) { - *(int *)&((caddr_t)&fregs->freebsd_ptrace_fpregs) - [offset - FREEBSD_U_SAVEFP_OFFSET] = data; - return 0; - } -#ifdef DIAGNOSTIC - printf("freebsd_ptrace_setregs: *(0x%08lx) = 0x%08x\n", offset, data); -#endif - return EFAULT; -} diff --git a/sys/arch/i386/i386/genassym.cf b/sys/arch/i386/i386/genassym.cf index 2b87e13ec17..1fa590045c4 100644 --- a/sys/arch/i386/i386/genassym.cf +++ b/sys/arch/i386/i386/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.32 2010/09/24 13:21:30 matthew Exp $ +# $OpenBSD: genassym.cf,v 1.33 2011/04/05 12:50:15 guenther Exp $ # # Copyright (c) 1982, 1990 The Regents of the University of California. # All rights reserved. @@ -59,10 +59,6 @@ if COMPAT_LINUX > 0 include <machine/linux_machdep.h> endif -if COMPAT_FREEBSD > 0 -include <machine/freebsd_machdep.h> -endif - if MULTIPROCESSOR include <machine/cpu.h> endif @@ -162,13 +158,6 @@ member SC sf_sc struct linux_sigcontext LINUX_ endif -# FreeBSD frame offsets -ifdef COMPAT_FREEBSD -struct freebsd_sigframe FREEBSD_SIGF_ -member HANDLER sf_handler -member SC sf_sc -endif - # Interrupt metering if NISA > 0 struct intrhand diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index 1f90906ffa6..25b4840189f 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.131 2011/03/12 03:52:26 guenther Exp $ */ +/* $OpenBSD: locore.s,v 1.132 2011/04/05 12:50:15 guenther Exp $ */ /* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */ /*- @@ -53,9 +53,6 @@ #ifdef COMPAT_LINUX #include <compat/linux/linux_syscall.h> #endif -#ifdef COMPAT_FREEBSD -#include <compat/freebsd/freebsd_syscall.h> -#endif #include <machine/cputypes.h> #include <machine/param.h> @@ -691,26 +688,6 @@ _C_LABEL(linux_esigcode): /*****************************************************************************/ -#ifdef COMPAT_FREEBSD -/* - * Signal trampoline; copied to top of user stack. - */ -NENTRY(freebsd_sigcode) - call *FREEBSD_SIGF_HANDLER(%esp) - leal FREEBSD_SIGF_SC(%esp),%eax # scp (the call may have clobbered - # the copy at SIGF_SCP(%esp)) - pushl %eax - pushl %eax # junk to fake return address - movl $FREEBSD_SYS_sigreturn,%eax - int $0x80 # enter kernel with args on stack - movl $FREEBSD_SYS_exit,%eax - int $0x80 # exit if sigreturn fails - .globl _C_LABEL(freebsd_esigcode) -_C_LABEL(freebsd_esigcode): -#endif - -/*****************************************************************************/ - /* * The following primitives are used to fill and copy regions of memory. */ diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index 4e54384fd7a..294be925d64 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.95 2011/04/03 14:56:28 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.96 2011/04/05 12:50:15 guenther Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -76,9 +76,6 @@ #include <compat/linux/linux_syscall.h> extern struct emul emul_linux_aout, emul_linux_elf; #endif -#ifdef COMPAT_FREEBSD -extern struct emul emul_freebsd_aout, emul_freebsd_elf; -#endif #ifdef COMPAT_AOUT extern struct emul emul_aout; #endif @@ -627,10 +624,6 @@ syscall(struct trapframe *frame) * quad alignment for the rest of the arguments. */ if (callp != sysent -#ifdef COMPAT_FREEBSD - && p->p_emul != &emul_freebsd_aout - && p->p_emul != &emul_freebsd_elf -#endif #ifdef COMPAT_AOUT && p->p_emul != &emul_aout #endif diff --git a/sys/arch/i386/include/freebsd_machdep.h b/sys/arch/i386/include/freebsd_machdep.h deleted file mode 100644 index 4ce829bf616..00000000000 --- a/sys/arch/i386/include/freebsd_machdep.h +++ /dev/null @@ -1,161 +0,0 @@ -/* $OpenBSD: freebsd_machdep.h,v 1.7 2003/06/02 23:27:47 millert Exp $ */ -/* $NetBSD: freebsd_machdep.h,v 1.1 1995/10/10 01:22:35 mycroft Exp $ */ - -/* - * Copyright (c) 1986, 1989, 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)signal.h 8.1 (Berkeley) 6/11/93 - * from: Id: signal.h,v 1.4 1994/08/21 04:55:30 paul Exp - * - * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 - * from: Id: frame.h,v 1.10 1995/03/16 18:11:42 bde Exp - */ -#ifndef _FREEBSD_MACHDEP_H -#define _FREEBSD_MACHDEP_H - -/* - * signal support - */ - -struct freebsd_sigcontext { - int sc_onstack; /* sigstack state to restore */ - int sc_mask; /* signal mask to restore */ - int sc_esp; /* machine state */ - int sc_ebp; - int sc_isp; - int sc_eip; - int sc_eflags; - int sc_es; - int sc_ds; - int sc_cs; - int sc_ss; - int sc_edi; - int sc_esi; - int sc_ebx; - int sc_edx; - int sc_ecx; - int sc_eax; -}; - -struct freebsd_sigframe { - int sf_signum; - int sf_code; - struct freebsd_sigcontext *sf_scp; - char *sf_addr; - sig_t sf_handler; - struct freebsd_sigcontext sf_sc; -}; - -/* - * freebsd_ptrace(2) support - */ - -#define FREEBSD_USRSTACK 0xefbfe000 /* USRSTACK */ -#define FREEBSD_U_AR0_OFFSET 0x0000045c /* offsetof(struct user, u_ar0) */ -#define FREEBSD_U_SAVEFP_OFFSET 0x00000070 - /* offsetof(struct user, u_pcb) + offsetof(struct pcb, pcb_savefpu) */ - -/* Exception/Trap Stack Frame */ -struct freebsd_trapframe { - int tf_es; - int tf_ds; - int tf_edi; - int tf_esi; - int tf_ebp; - int tf_isp; - int tf_ebx; - int tf_edx; - int tf_ecx; - int tf_eax; - int tf_trapno; - /* below portion defined in 386 hardware */ - int tf_err; - int tf_eip; - int tf_cs; - int tf_eflags; - /* below only when transitting rings (e.g. user to kernel) */ - int tf_esp; - int tf_ss; -}; - -/* Environment information of floating point unit */ -struct freebsd_env87 { - long en_cw; /* control word (16bits) */ - long en_sw; /* status word (16bits) */ - long en_tw; /* tag word (16bits) */ - long en_fip; /* floating point instruction pointer */ - u_short en_fcs; /* floating code segment selector */ - u_short en_opcode; /* opcode last executed (11 bits ) */ - long en_foo; /* floating operand offset */ - long en_fos; /* floating operand segment selector */ -}; - -/* Contents of each floating point accumulator */ -struct freebsd_fpacc87 { -#ifdef dontdef /* too unportable */ - u_long fp_mantlo; /* mantissa low (31:0) */ - u_long fp_manthi; /* mantissa high (63:32) */ - int fp_exp:15; /* exponent */ - int fp_sgn:1; /* mantissa sign */ -#else - u_char fp_bytes[10]; -#endif -}; - -/* Floating point context */ -struct freebsd_save87 { - struct freebsd_env87 sv_env; /* floating point control/status */ - struct freebsd_fpacc87 sv_ac[8]; /* accumulator contents, 0-7 */ - u_long sv_ex_sw; /* status word for last exception */ - /* - * Bogus padding for emulators. Emulators should use their own - * struct and arrange to store into this struct (ending here) - * before it is inspected for ptracing or for core dumps. Some - * emulators overwrite the whole struct. We have no good way of - * knowing how much padding to leave. Leave just enough for the - * GPL emulator's i387_union (176 bytes total). - */ - u_char sv_pad[64]; /* padding; used by emulators */ -}; - -struct freebsd_ptrace_reg { - struct freebsd_trapframe freebsd_ptrace_regs; - struct freebsd_save87 freebsd_ptrace_fpregs; -}; - -/* sys/i386/include/exec.h */ -#define FREEBSD___LDPGSZ 4096 - -#ifdef _KERNEL -void freebsd_sendsig(sig_t, int, int, u_long, int, union sigval); -#endif - -#endif /* _FREEBSD_MACHDEP_H */ |