Deleted Added
full compact
linux_sysvec.c (68519) linux_sysvec.c (68520)
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/i386/linux/linux_sysvec.c 68519 2000-11-09 07:27:55Z marcel $
28 * $FreeBSD: head/sys/i386/linux/linux_sysvec.c 68520 2000-11-09 08:25:48Z marcel $
29 */
30
31/* XXX we use functions that might not exist. */
32#include "opt_compat.h"
33
34#ifndef COMPAT_43
35#error "Unable to compile Linux-emulator due to missing COMPAT_43 option!"
36#endif

--- 591 unchanged lines hidden (view full) ---

628 regs->tf_ecx = context->sc_ecx;
629 regs->tf_eax = context->sc_eax;
630 regs->tf_eip = context->sc_eip;
631 regs->tf_cs = context->sc_cs;
632 regs->tf_eflags = eflags;
633 regs->tf_esp = context->sc_esp_at_signal;
634 regs->tf_ss = context->sc_ss;
635
29 */
30
31/* XXX we use functions that might not exist. */
32#include "opt_compat.h"
33
34#ifndef COMPAT_43
35#error "Unable to compile Linux-emulator due to missing COMPAT_43 option!"
36#endif

--- 591 unchanged lines hidden (view full) ---

628 regs->tf_ecx = context->sc_ecx;
629 regs->tf_eax = context->sc_eax;
630 regs->tf_eip = context->sc_eip;
631 regs->tf_cs = context->sc_cs;
632 regs->tf_eflags = eflags;
633 regs->tf_esp = context->sc_esp_at_signal;
634 regs->tf_ss = context->sc_ss;
635
636
637 /*
638 * call sigaltstack & ignore results..
639 */
640 ss = stackgap_alloc(&sg, sizeof(stack_t));
641 lss = &uc.uc_stack;
642 ss->ss_sp = lss->ss_sp;
636 /*
637 * call sigaltstack & ignore results..
638 */
639 ss = stackgap_alloc(&sg, sizeof(stack_t));
640 lss = &uc.uc_stack;
641 ss->ss_sp = lss->ss_sp;
643 ss->ss_size = (lss->ss_size >= LINUX_MINSIGSTKSZ &&
644 lss->ss_size < MINSIGSTKSZ) ? MINSIGSTKSZ : lss->ss_size;
642 ss->ss_size = lss->ss_size;
645 ss->ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);
646
647#ifdef DEBUG
648 printf("Linux-emul(%ld): rt_sigret flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x\n",
649 (long)p->p_pid, ss->ss_flags, ss->ss_sp, ss->ss_size, context->sc_mask);
650#endif
651 sasargs.ss = ss;
652 sasargs.oss = NULL;

--- 68 unchanged lines hidden (view full) ---

721 translate_traps,
722 linux_fixup,
723 linux_sendsig,
724 linux_sigcode,
725 &linux_szsigcode,
726 linux_prepsyscall,
727 "Linux a.out",
728 aout_coredump,
643 ss->ss_flags = linux_to_bsd_sigaltstack(lss->ss_flags);
644
645#ifdef DEBUG
646 printf("Linux-emul(%ld): rt_sigret flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x\n",
647 (long)p->p_pid, ss->ss_flags, ss->ss_sp, ss->ss_size, context->sc_mask);
648#endif
649 sasargs.ss = ss;
650 sasargs.oss = NULL;

--- 68 unchanged lines hidden (view full) ---

719 translate_traps,
720 linux_fixup,
721 linux_sendsig,
722 linux_sigcode,
723 &linux_szsigcode,
724 linux_prepsyscall,
725 "Linux a.out",
726 aout_coredump,
729 exec_linux_imgact_try
727 exec_linux_imgact_try,
728 LINUX_MINSIGSTKSZ
730};
731
732struct sysentvec elf_linux_sysvec = {
733 LINUX_SYS_MAXSYSCALL,
734 linux_sysent,
735 0xff,
736 LINUX_SIGTBLSZ,
737 bsd_to_linux_signal,
738 ELAST + 1,
739 bsd_to_linux_errno,
740 translate_traps,
741 elf_linux_fixup,
742 linux_sendsig,
743 linux_sigcode,
744 &linux_szsigcode,
745 linux_prepsyscall,
746 "Linux ELF",
747 elf_coredump,
729};
730
731struct sysentvec elf_linux_sysvec = {
732 LINUX_SYS_MAXSYSCALL,
733 linux_sysent,
734 0xff,
735 LINUX_SIGTBLSZ,
736 bsd_to_linux_signal,
737 ELAST + 1,
738 bsd_to_linux_errno,
739 translate_traps,
740 elf_linux_fixup,
741 linux_sendsig,
742 linux_sigcode,
743 &linux_szsigcode,
744 linux_prepsyscall,
745 "Linux ELF",
746 elf_coredump,
748 exec_linux_imgact_try
747 exec_linux_imgact_try,
748 LINUX_MINSIGSTKSZ
749};
750
751static Elf32_Brandinfo linux_brand = {
752 ELFOSABI_LINUX,
753 "/compat/linux",
754 "/lib/ld-linux.so.1",
755 &elf_linux_sysvec
756 };

--- 65 unchanged lines hidden ---
749};
750
751static Elf32_Brandinfo linux_brand = {
752 ELFOSABI_LINUX,
753 "/compat/linux",
754 "/lib/ld-linux.so.1",
755 &elf_linux_sysvec
756 };

--- 65 unchanged lines hidden ---