linux_sysvec.c (198507) | linux_sysvec.c (205642) |
---|---|
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 198507 2009-10-27 10:47:58Z kib $"); | 30__FBSDID("$FreeBSD: head/sys/i386/linux/linux_sysvec.c 205642 2010-03-25 14:24:00Z nwhitehorn $"); |
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> --- 61 unchanged lines hidden (view full) --- 100 101static int linux_fixup(register_t **stack_base, 102 struct image_params *iparams); 103static int elf_linux_fixup(register_t **stack_base, 104 struct image_params *iparams); 105static void linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, 106 caddr_t *params); 107static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); | 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> --- 61 unchanged lines hidden (view full) --- 100 101static int linux_fixup(register_t **stack_base, 102 struct image_params *iparams); 103static int elf_linux_fixup(register_t **stack_base, 104 struct image_params *iparams); 105static void linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, 106 caddr_t *params); 107static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); |
108static void exec_linux_setregs(struct thread *td, u_long entry, 109 u_long stack, u_long ps_strings); | 108static void exec_linux_setregs(struct thread *td, 109 struct image_params *imgp, u_long stack); |
110static register_t *linux_copyout_strings(struct image_params *imgp); 111static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel); 112 113static int linux_szplatform; 114const char *linux_platform; 115 116static eventhandler_tag linux_exit_tag; 117static eventhandler_tag linux_schedtail_tag; --- 804 unchanged lines hidden (view full) --- 922} 923 924/* 925 * exec_setregs may initialize some registers differently than Linux 926 * does, thus potentially confusing Linux binaries. If necessary, we 927 * override the exec_setregs default(s) here. 928 */ 929static void | 110static register_t *linux_copyout_strings(struct image_params *imgp); 111static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel); 112 113static int linux_szplatform; 114const char *linux_platform; 115 116static eventhandler_tag linux_exit_tag; 117static eventhandler_tag linux_schedtail_tag; --- 804 unchanged lines hidden (view full) --- 922} 923 924/* 925 * exec_setregs may initialize some registers differently than Linux 926 * does, thus potentially confusing Linux binaries. If necessary, we 927 * override the exec_setregs default(s) here. 928 */ 929static void |
930exec_linux_setregs(struct thread *td, u_long entry, 931 u_long stack, u_long ps_strings) | 930exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack) |
932{ 933 struct pcb *pcb = td->td_pcb; 934 | 931{ 932 struct pcb *pcb = td->td_pcb; 933 |
935 exec_setregs(td, entry, stack, ps_strings); | 934 exec_setregs(td, imgp, stack); |
936 937 /* Linux sets %gs to 0, we default to _udatasel */ 938 pcb->pcb_gs = 0; 939 load_gs(0); 940 941 pcb->pcb_initial_npxcw = __LINUX_NPXCW__; 942} 943 --- 227 unchanged lines hidden --- | 935 936 /* Linux sets %gs to 0, we default to _udatasel */ 937 pcb->pcb_gs = 0; 938 load_gs(0); 939 940 pcb->pcb_initial_npxcw = __LINUX_NPXCW__; 941} 942 --- 227 unchanged lines hidden --- |