1/*-
2 * Copyright (c) 2004 Tim J. Robbins
3 * Copyright (c) 2003 Peter Wemm
4 * Copyright (c) 2002 Doug Rabson
5 * Copyright (c) 1998-1999 Andrew Gallatin
6 * Copyright (c) 1994-1996 S�ren Schmidt
7 * All rights reserved.
8 *
--- 17 unchanged lines hidden (view full) ---
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_sysvec.c 195486 2009-07-09 09:34:11Z kib $");
35#include "opt_compat.h"
36
37#ifndef COMPAT_IA32
38#error "Unable to compile Linux-emulator due to missing COMPAT_IA32 option!"
39#endif
40
41#define __ELF_WORD_SIZE 32
42
--- 79 unchanged lines hidden (view full) ---
122 struct image_params *iparams);
123static register_t *linux_copyout_strings(struct image_params *imgp);
124static void linux_prepsyscall(struct trapframe *tf, int *args, u_int *code,
125 caddr_t *params);
126static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
127static void exec_linux_setregs(struct thread *td, u_long entry,
128 u_long stack, u_long ps_strings);
129static void linux32_fixlimit(struct rlimit *rl, int which);
130
131static eventhandler_tag linux_exit_tag;
132static eventhandler_tag linux_schedtail_tag;
133static eventhandler_tag linux_exec_tag;
134
135/*
136 * Linux syscalls return negative errno's, we do positive and map them
137 * Reference:
--- 923 unchanged lines hidden (view full) ---
1061 .sv_stackprot = VM_PROT_ALL,
1062 .sv_copyout_strings = linux_copyout_strings,
1063 .sv_setregs = exec_linux_setregs,
1064 .sv_fixlimit = linux32_fixlimit,
1065 .sv_maxssiz = &linux32_maxssiz,
1066 .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32
1067};
1068
1069static char GNULINUX_ABI_VENDOR[] = "GNU";
1070
1071static Elf_Brandnote linux32_brandnote = {
1072 .hdr.n_namesz = sizeof(GNULINUX_ABI_VENDOR),
1073 .hdr.n_descsz = 16,
1074 .hdr.n_type = 1,
1075 .vendor = GNULINUX_ABI_VENDOR,
1076 .flags = 0
1077};
1078
1079static Elf32_Brandinfo linux_brand = {
1080 .brand = ELFOSABI_LINUX,
1081 .machine = EM_386,
1082 .compat_3_brand = "Linux",
1083 .emul_path = "/compat/linux",
1084 .interp_path = "/lib/ld-linux.so.1",
--- 105 unchanged lines hidden ---
2 * Copyright (c) 2004 Tim J. Robbins
3 * Copyright (c) 2003 Peter Wemm
4 * Copyright (c) 2002 Doug Rabson
5 * Copyright (c) 1998-1999 Andrew Gallatin
6 * Copyright (c) 1994-1996 S�ren Schmidt
7 * All rights reserved.
8 *
--- 17 unchanged lines hidden (view full) ---
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/amd64/linux32/linux32_sysvec.c 195486 2009-07-09 09:34:11Z kib $");
35#include "opt_compat.h"
36
37#ifndef COMPAT_IA32
38#error "Unable to compile Linux-emulator due to missing COMPAT_IA32 option!"
39#endif
40
41#define __ELF_WORD_SIZE 32
42
--- 79 unchanged lines hidden (view full) ---
122 struct image_params *iparams);
123static register_t *linux_copyout_strings(struct image_params *imgp);
124static void linux_prepsyscall(struct trapframe *tf, int *args, u_int *code,
125 caddr_t *params);
126static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
127static void exec_linux_setregs(struct thread *td, u_long entry,
128 u_long stack, u_long ps_strings);
129static void linux32_fixlimit(struct rlimit *rl, int which);
130
131static eventhandler_tag linux_exit_tag;
132static eventhandler_tag linux_schedtail_tag;
133static eventhandler_tag linux_exec_tag;
134
135/*
136 * Linux syscalls return negative errno's, we do positive and map them
137 * Reference:
--- 923 unchanged lines hidden (view full) ---
1061 .sv_stackprot = VM_PROT_ALL,
1062 .sv_copyout_strings = linux_copyout_strings,
1063 .sv_setregs = exec_linux_setregs,
1064 .sv_fixlimit = linux32_fixlimit,
1065 .sv_maxssiz = &linux32_maxssiz,
1066 .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32
1067};
1068
1069static char GNULINUX_ABI_VENDOR[] = "GNU";
1070
1071static Elf_Brandnote linux32_brandnote = {
1072 .hdr.n_namesz = sizeof(GNULINUX_ABI_VENDOR),
1073 .hdr.n_descsz = 16,
1074 .hdr.n_type = 1,
1075 .vendor = GNULINUX_ABI_VENDOR,
1076 .flags = 0
1077};
1078
1079static Elf32_Brandinfo linux_brand = {
1080 .brand = ELFOSABI_LINUX,
1081 .machine = EM_386,
1082 .compat_3_brand = "Linux",
1083 .emul_path = "/compat/linux",
1084 .interp_path = "/lib/ld-linux.so.1",
--- 105 unchanged lines hidden ---