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 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 = { |
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 |
843}; 844 845struct sysentvec elf_linux_sysvec = { |
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 |
873}; 874 875static Elf32_Brandinfo linux_brand = { |
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}; |
885 886static Elf32_Brandinfo linux_glibc2brand = { |
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}; |
896 897Elf32_Brandinfo *linux_brandlist[] = { |
898 &linux_brand, 899 &linux_glibc2brand, 900 NULL 901}; |
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 --- |