summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_exec.c
diff options
context:
space:
mode:
authorjdolecek <jdolecek@NetBSD.org>2000-11-21 00:37:49 +0000
committerjdolecek <jdolecek@NetBSD.org>2000-11-21 00:37:49 +0000
commitbaae0324b90e27947452a7dca4476ec2541ed880 (patch)
treec16af02b061231b8dbfe3f7455f7f547e4d7e473 /sys/compat/linux/common/linux_exec.c
parent1a5d87c9faf1adf855ca1499bd989f9f80a8d2aa (diff)
restructure struct emul and execsw, in preparation to make emulations LKMable:
* move all exec-type specific information from struct emul to execsw[] and provide single struct emul per emulation * elf: - kern/exec_elf32.c:probe_funcs[] is gone, execsw[] how has one entry per emulation and contains pointer to respective probe function - interp is allocated via MALLOC() rather than on stack - elf_args structure is allocated via MALLOC() rather than malloc() * ecoff: the per-emulation hooks moved from alpha and mips specific code to OSF1 and Ultrix compat code as appropriate, execsw[] has one entry per emulation supporting ecoff with appropriate probe function * the makecmds/probe functions don't set emulation, pointer to emulation is part of appropriate execsw[] entry * constify couple of structures
Diffstat (limited to 'sys/compat/linux/common/linux_exec.c')
-rw-r--r--sys/compat/linux/common/linux_exec.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/sys/compat/linux/common/linux_exec.c b/sys/compat/linux/common/linux_exec.c
index b0ace37dbea..ef191af4140 100644
--- a/sys/compat/linux/common/linux_exec.c
+++ b/sys/compat/linux/common/linux_exec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.c,v 1.37 2000/06/29 02:40:38 mrg Exp $ */
+/* $NetBSD: linux_exec.c,v 1.38 2000/11/21 00:37:53 jdolecek Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
@@ -62,10 +62,15 @@
#include <compat/linux/linux_syscallargs.h>
#include <compat/linux/linux_syscall.h>
-
+#include <compat/linux/common/linux_misc.h>
+#include <compat/linux/common/linux_errno.h>
const char linux_emul_path[] = "/emul/linux";
+extern struct sysent linux_sysent[];
+extern const char * const linux_syscallnames[];
+extern char linux_sigcode[], linux_esigcode[];
+
/*
* Execve(2). Just check the alternate emulation path, and pass it on
* to the NetBSD execve().
@@ -93,3 +98,18 @@ linux_sys_execve(p, v, retval)
return sys_execve(p, &ap, retval);
}
+
+/*
+ * Emulation switch.
+ */
+const struct emul emul_linux = {
+ "linux",
+ native_to_linux_errno,
+ linux_sendsig,
+ LINUX_SYS_syscall,
+ LINUX_SYS_MAXSYSCALL,
+ linux_sysent,
+ linux_syscallnames,
+ linux_sigcode,
+ linux_esigcode,
+};