Deleted Added
full compact
linux_sysvec.c (177997) linux_sysvec.c (183322)
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

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

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
29#include <sys/cdefs.h>
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

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

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
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/i386/linux/linux_sysvec.c 177997 2008-04-08 09:45:49Z kib $");
30__FBSDID("$FreeBSD: head/sys/i386/linux/linux_sysvec.c 183322 2008-09-24 10:14:37Z kib $");
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/exec.h>
35#include <sys/fcntl.h>
36#include <sys/imgact.h>
37#include <sys/imgact_aout.h>
38#include <sys/imgact_elf.h>

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

808 /* Linux sets %gs to 0, we default to _udatasel */
809 pcb->pcb_gs = 0; load_gs(0);
810
811 /* Linux sets the i387 to extended precision. */
812 fldcw(&control);
813}
814
815struct sysentvec linux_sysvec = {
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/exec.h>
35#include <sys/fcntl.h>
36#include <sys/imgact.h>
37#include <sys/imgact_aout.h>
38#include <sys/imgact_elf.h>

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

808 /* Linux sets %gs to 0, we default to _udatasel */
809 pcb->pcb_gs = 0; load_gs(0);
810
811 /* Linux sets the i387 to extended precision. */
812 fldcw(&control);
813}
814
815struct sysentvec linux_sysvec = {
816 LINUX_SYS_MAXSYSCALL,
817 linux_sysent,
818 0,
819 LINUX_SIGTBLSZ,
820 bsd_to_linux_signal,
821 ELAST + 1,
822 bsd_to_linux_errno,
823 translate_traps,
824 linux_fixup,
825 linux_sendsig,
826 linux_sigcode,
827 &linux_szsigcode,
828 linux_prepsyscall,
829 "Linux a.out",
830 NULL,
831 exec_linux_imgact_try,
832 LINUX_MINSIGSTKSZ,
833 PAGE_SIZE,
834 VM_MIN_ADDRESS,
835 VM_MAXUSER_ADDRESS,
836 USRSTACK,
837 PS_STRINGS,
838 VM_PROT_ALL,
839 exec_copyout_strings,
840 exec_linux_setregs,
841 NULL
816 .sv_size = LINUX_SYS_MAXSYSCALL,
817 .sv_table = linux_sysent,
818 .sv_mask = 0,
819 .sv_sigsize = LINUX_SIGTBLSZ,
820 .sv_sigtbl = bsd_to_linux_signal,
821 .sv_errsize = ELAST + 1,
822 .sv_errtbl = bsd_to_linux_errno,
823 .sv_transtrap = translate_traps,
824 .sv_fixup = linux_fixup,
825 .sv_sendsig = linux_sendsig,
826 .sv_sigcode = linux_sigcode,
827 .sv_szsigcode = &linux_szsigcode,
828 .sv_prepsyscall = linux_prepsyscall,
829 .sv_name = "Linux a.out",
830 .sv_coredump = NULL,
831 .sv_imgact_try = exec_linux_imgact_try,
832 .sv_minsigstksz = LINUX_MINSIGSTKSZ,
833 .sv_pagesize = PAGE_SIZE,
834 .sv_minuser = VM_MIN_ADDRESS,
835 .sv_maxuser = VM_MAXUSER_ADDRESS,
836 .sv_usrstack = USRSTACK,
837 .sv_psstrings = PS_STRINGS,
838 .sv_stackprot = VM_PROT_ALL,
839 .sv_copyout_strings = exec_copyout_strings,
840 .sv_setregs = exec_linux_setregs,
841 .sv_fixlimit = NULL,
842 .sv_maxssiz = NULL
842};
843
844struct sysentvec elf_linux_sysvec = {
843};
844
845struct sysentvec elf_linux_sysvec = {
845 LINUX_SYS_MAXSYSCALL,
846 linux_sysent,
847 0,
848 LINUX_SIGTBLSZ,
849 bsd_to_linux_signal,
850 ELAST + 1,
851 bsd_to_linux_errno,
852 translate_traps,
853 elf_linux_fixup,
854 linux_sendsig,
855 linux_sigcode,
856 &linux_szsigcode,
857 linux_prepsyscall,
858 "Linux ELF",
859 elf32_coredump,
860 exec_linux_imgact_try,
861 LINUX_MINSIGSTKSZ,
862 PAGE_SIZE,
863 VM_MIN_ADDRESS,
864 VM_MAXUSER_ADDRESS,
865 USRSTACK,
866 PS_STRINGS,
867 VM_PROT_ALL,
868 exec_copyout_strings,
869 exec_linux_setregs,
870 NULL
846 .sv_size = LINUX_SYS_MAXSYSCALL,
847 .sv_table = linux_sysent,
848 .sv_mask = 0,
849 .sv_sigsize = LINUX_SIGTBLSZ,
850 .sv_sigtbl = bsd_to_linux_signal,
851 .sv_errsize = ELAST + 1,
852 .sv_errtbl = bsd_to_linux_errno,
853 .sv_transtrap = translate_traps,
854 .sv_fixup = elf_linux_fixup,
855 .sv_sendsig = linux_sendsig,
856 .sv_sigcode = linux_sigcode,
857 .sv_szsigcode = &linux_szsigcode,
858 .sv_prepsyscall = linux_prepsyscall,
859 .sv_name = "Linux ELF",
860 .sv_coredump = elf32_coredump,
861 .sv_imgact_try = exec_linux_imgact_try,
862 .sv_minsigstksz = LINUX_MINSIGSTKSZ,
863 .sv_pagesize = PAGE_SIZE,
864 .sv_minuser = VM_MIN_ADDRESS,
865 .sv_maxuser = VM_MAXUSER_ADDRESS,
866 .sv_usrstack = USRSTACK,
867 .sv_psstrings = PS_STRINGS,
868 .sv_stackprot = VM_PROT_ALL,
869 .sv_copyout_strings = exec_copyout_strings,
870 .sv_setregs = exec_linux_setregs,
871 .sv_fixlimit = NULL,
872 .sv_maxssiz = NULL
871};
872
873static Elf32_Brandinfo linux_brand = {
873};
874
875static Elf32_Brandinfo linux_brand = {
874 ELFOSABI_LINUX,
875 EM_386,
876 "Linux",
877 "/compat/linux",
878 "/lib/ld-linux.so.1",
879 &elf_linux_sysvec,
880 NULL,
881 BI_CAN_EXEC_DYN,
882 };
876 .brand = ELFOSABI_LINUX,
877 .machine = EM_386,
878 .compat_3_brand = "Linux",
879 .emul_path = "/compat/linux",
880 .interp_path = "/lib/ld-linux.so.1",
881 .sysvec = &elf_linux_sysvec,
882 .interp_newpath = NULL,
883 .flags = BI_CAN_EXEC_DYN,
884};
883
884static Elf32_Brandinfo linux_glibc2brand = {
885
886static Elf32_Brandinfo linux_glibc2brand = {
885 ELFOSABI_LINUX,
886 EM_386,
887 "Linux",
888 "/compat/linux",
889 "/lib/ld-linux.so.2",
890 &elf_linux_sysvec,
891 NULL,
892 BI_CAN_EXEC_DYN,
893 };
887 .brand = ELFOSABI_LINUX,
888 .machine = EM_386,
889 .compat_3_brand = "Linux",
890 .emul_path = "/compat/linux",
891 .interp_path = "/lib/ld-linux.so.2",
892 .sysvec = &elf_linux_sysvec,
893 .interp_newpath = NULL,
894 .flags = BI_CAN_EXEC_DYN,
895};
894
895Elf32_Brandinfo *linux_brandlist[] = {
896
897Elf32_Brandinfo *linux_brandlist[] = {
896 &linux_brand,
897 &linux_glibc2brand,
898 NULL
899 };
898 &linux_brand,
899 &linux_glibc2brand,
900 NULL
901};
900
901static int
902linux_elf_modevent(module_t mod, int type, void *data)
903{
904 Elf32_Brandinfo **brandinfo;
905 int error;
906 struct linux_ioctl_handler **lihp;
907 struct linux_device_handler **ldhp;

--- 69 unchanged lines hidden ---
902
903static int
904linux_elf_modevent(module_t mod, int type, void *data)
905{
906 Elf32_Brandinfo **brandinfo;
907 int error;
908 struct linux_ioctl_handler **lihp;
909 struct linux_device_handler **ldhp;

--- 69 unchanged lines hidden ---