Deleted Added
full compact
linux_sysvec.c (293514) linux_sysvec.c (293516)
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: stable/10/sys/i386/linux/linux_sysvec.c 293514 2016-01-09 15:44:38Z dchagin $");
30__FBSDID("$FreeBSD: stable/10/sys/i386/linux/linux_sysvec.c 293516 2016-01-09 15:48:11Z dchagin $");
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>

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

113static void exec_linux_setregs(struct thread *td,
114 struct image_params *imgp, u_long stack);
115static register_t *linux_copyout_strings(struct image_params *imgp);
116static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
117static void linux_vdso_install(void *param);
118static void linux_vdso_deinstall(void *param);
119
120static int linux_szplatform;
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>

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

113static void exec_linux_setregs(struct thread *td,
114 struct image_params *imgp, u_long stack);
115static register_t *linux_copyout_strings(struct image_params *imgp);
116static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
117static void linux_vdso_install(void *param);
118static void linux_vdso_deinstall(void *param);
119
120static int linux_szplatform;
121const char *linux_platform;
121const char *linux_kplatform;
122
123static eventhandler_tag linux_exit_tag;
124static eventhandler_tag linux_exec_tag;
125static eventhandler_tag linux_thread_dtor_tag;
126
127/*
128 * Linux syscalls return negative errno's, we do positive and map them
129 * Reference:

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

325 p = imgp->proc;
326 arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
327 destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform -
328 roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
329
330 /*
331 * install LINUX_PLATFORM
332 */
122
123static eventhandler_tag linux_exit_tag;
124static eventhandler_tag linux_exec_tag;
125static eventhandler_tag linux_thread_dtor_tag;
126
127/*
128 * Linux syscalls return negative errno's, we do positive and map them
129 * Reference:

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

325 p = imgp->proc;
326 arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings;
327 destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform -
328 roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *));
329
330 /*
331 * install LINUX_PLATFORM
332 */
333 copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform),
333 copyout(linux_kplatform, ((caddr_t)arginfo - linux_szplatform),
334 linux_szplatform);
335
336 /*
337 * If we have a valid auxargs ptr, prepare some room
338 * on the stack.
339 */
340 if (imgp->auxargs) {
341 /*

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

1148 LIST_INIT(&futex_list);
1149 mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF);
1150 linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit,
1151 NULL, 1000);
1152 linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec,
1153 NULL, 1000);
1154 linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor,
1155 linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY);
334 linux_szplatform);
335
336 /*
337 * If we have a valid auxargs ptr, prepare some room
338 * on the stack.
339 */
340 if (imgp->auxargs) {
341 /*

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

1148 LIST_INIT(&futex_list);
1149 mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF);
1150 linux_exit_tag = EVENTHANDLER_REGISTER(process_exit, linux_proc_exit,
1151 NULL, 1000);
1152 linux_exec_tag = EVENTHANDLER_REGISTER(process_exec, linux_proc_exec,
1153 NULL, 1000);
1154 linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor,
1155 linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY);
1156 linux_get_machine(&linux_platform);
1157 linux_szplatform = roundup(strlen(linux_platform) + 1,
1156 linux_get_machine(&linux_kplatform);
1157 linux_szplatform = roundup(strlen(linux_kplatform) + 1,
1158 sizeof(char *));
1159 linux_osd_jail_register();
1160 stclohz = (stathz ? stathz : hz);
1161 if (bootverbose)
1162 printf("Linux ELF exec handler installed\n");
1163 } else
1164 printf("cannot insert Linux ELF brand handler\n");
1165 break;

--- 39 unchanged lines hidden ---
1158 sizeof(char *));
1159 linux_osd_jail_register();
1160 stclohz = (stathz ? stathz : hz);
1161 if (bootverbose)
1162 printf("Linux ELF exec handler installed\n");
1163 } else
1164 printf("cannot insert Linux ELF brand handler\n");
1165 break;

--- 39 unchanged lines hidden ---