Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/mach add a shell that does nothing for now for th...



details:   https://anonhg.NetBSD.org/src/rev/cd6091109e5b
branches:  trunk
changeset: 512693:cd6091109e5b
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jul 14 02:10:59 2001 +0000

description:
add a shell that does nothing for now for the mach syscalls.

diffstat:

 sys/compat/mach/Makefile           |   11 +
 sys/compat/mach/files.mach         |   12 +
 sys/compat/mach/mach_exec.c        |  136 +++++++++++++
 sys/compat/mach/mach_exec.h        |   47 ++++
 sys/compat/mach/mach_misc.c        |  366 +++++++++++++++++++++++++++++++++++++
 sys/compat/mach/mach_syscall.h     |  101 ++++++++++
 sys/compat/mach/mach_syscallargs.h |  175 +++++++++++++++++
 sys/compat/mach/mach_syscalls.c    |  154 +++++++++++++++
 sys/compat/mach/mach_sysent.c      |  283 ++++++++++++++++++++++++++++
 sys/compat/mach/mach_types.h       |   65 ++++++
 sys/compat/mach/syscalls.conf      |   13 +
 sys/compat/mach/syscalls.master    |  224 ++++++++++++++++++++++
 12 files changed, 1587 insertions(+), 0 deletions(-)

diffs (truncated from 1635 to 300 lines):

diff -r 47ed569e28ce -r cd6091109e5b sys/compat/mach/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/mach/Makefile  Sat Jul 14 02:10:59 2001 +0000
@@ -0,0 +1,11 @@
+#      $NetBSD: Makefile,v 1.1 2001/07/14 02:10:59 christos Exp $
+
+DEP=   syscalls.conf syscalls.master ../../kern/makesyscalls.sh
+OBJS=  mach_sysent.c mach_syscalls.c mach_syscall.h mach_syscallargs.h
+
+${OBJS}: ${DEP}
+       -mv -f mach_sysent.c mach_sysent.c.bak
+       -mv -f mach_syscalls.c mach_syscalls.c.bak
+       -mv -f mach_syscall.h mach_syscall.h.bak
+       -mv -f mach_syscallargs.h mach_syscallargs.h.bak
+       sh ../../kern/makesyscalls.sh syscalls.conf syscalls.master
diff -r 47ed569e28ce -r cd6091109e5b sys/compat/mach/files.mach
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/mach/files.mach        Sat Jul 14 02:10:59 2001 +0000
@@ -0,0 +1,12 @@
+#      $NetBSD: files.mach,v 1.1 2001/07/14 02:10:59 christos Exp $
+#
+# Config file description for machine-independent SVR4 compat code.
+# Included by ports that need it.
+
+# ports should define any machine-specific files they need in their
+# own file lists.
+
+file   compat/mach/mach_syscalls.c     compat_mach
+file   compat/mach/mach_sysent.c       compat_mach
+file   compat/mach/mach_misc.c         compat_mach
+file   compat/mach/mach_exec.c         compat_mach
diff -r 47ed569e28ce -r cd6091109e5b sys/compat/mach/mach_exec.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/mach/mach_exec.c       Sat Jul 14 02:10:59 2001 +0000
@@ -0,0 +1,136 @@
+/*     $NetBSD: mach_exec.c,v 1.1 2001/07/14 02:11:00 christos Exp $    */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/exec.h>
+#include <sys/malloc.h>
+
+#include <sys/syscall.h>
+
+#include <compat/mach/mach_types.h>
+#include <compat/mach/mach_exec.h>
+
+extern char sigcode[], esigcode[];
+extern struct sysent sysent[];
+#ifdef SYSCALL_DEBUG
+extern const char * const syscallnames[];
+#endif
+#ifndef __HAVE_SYSCALL_INTERN
+void syscall __P((void));
+#else
+void mach_syscall_intern __P((struct proc *));
+#endif
+
+const struct emul emul_mach = {
+       "mach",
+       "/emul/mach",
+#ifndef __HAVE_MINIMAL_EMUL
+       0,
+       0,
+       SYS_syscall,
+       SYS_MAXSYSCALL,
+#endif
+       sysent,
+#ifdef SYSCALL_DEBUG
+       syscallnames,
+#else
+       NULL,
+#endif
+       sendsig,
+       trapsignal,
+       sigcode,
+       esigcode,
+       NULL,
+       NULL,
+       NULL,
+#ifdef __HAVE_SYSCALL_INTERN
+       mach_syscall_intern,
+#else
+       syscall,
+#endif
+};
+
+/*
+ * Copy arguments onto the stack in the normal way, but add some
+ * extra information in case of dynamic binding.
+ */
+void *
+exec_mach_copyargs(struct exec_package *pack, struct ps_strings *arginfo,
+    void *stack, void *argp)
+{
+       char path[MAXPATHLEN];
+       size_t len;
+       size_t zero = 0;
+
+       stack = copyargs(pack, arginfo, stack, argp);
+       if (!stack)
+               return NULL;
+
+       if (copyout(&zero, stack, sizeof(zero)))
+               return NULL;
+       stack = (char *)stack + sizeof(zero);
+
+       /* do the really stupid thing */
+       if (copyinstr(pack->ep_name, path, MAXPATHLEN, &len))
+               return NULL;
+       if (copyout(path, stack, len))
+               return NULL;
+       stack = (char *)stack + len;
+
+       len = len % sizeof(zero);
+       if (len) {
+               if (copyout(&zero, stack, len))
+                       return NULL;
+               stack = (char *)stack + len;
+       }
+
+       if (copyout(&zero, stack, sizeof(zero)))
+               return NULL;
+       stack = (char *)stack + sizeof(zero);
+
+       return stack;
+}
+
+int
+exec_mach_probe(char **path) {
+       *path = malloc(strlen(emul_mach.e_path) + 1, M_TEMP, M_WAITOK);
+       (void)strcpy(*path, emul_mach.e_path);
+       return 0;
+}
diff -r 47ed569e28ce -r cd6091109e5b sys/compat/mach/mach_exec.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/mach/mach_exec.h       Sat Jul 14 02:10:59 2001 +0000
@@ -0,0 +1,47 @@
+/*     $NetBSD: mach_exec.h,v 1.1 2001/07/14 02:11:00 christos Exp $    */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef        _MACH_EXEC_H_
+#define        _MACH_EXEC_H_
+
+void *exec_mach_copyargs __P((struct exec_package *, struct ps_strings *,
+    void *, void *));
+int exec_mach_probe __P((char **));
+extern const struct emul emul_mach;
+
+#endif /* !_MACH_EXEC_H_ */
diff -r 47ed569e28ce -r cd6091109e5b sys/compat/mach/mach_misc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/mach/mach_misc.c       Sat Jul 14 02:10:59 2001 +0000
@@ -0,0 +1,366 @@
+/*     $NetBSD: mach_misc.c,v 1.1 2001/07/14 02:11:00 christos Exp $    */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * MACH compatibility module.
+ *
+ * We actually don't implement anything here yet!
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/namei.h>
+#include <sys/dirent.h>
+#include <sys/proc.h>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/filedesc.h>
+#include <sys/ioctl.h>
+#include <sys/kernel.h>
+#include <sys/malloc.h>
+#include <sys/pool.h>
+#include <sys/mbuf.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/resource.h>
+#include <sys/resourcevar.h>
+#include <sys/socket.h>
+#include <sys/vnode.h>
+#include <sys/uio.h>
+#include <sys/wait.h>
+#include <sys/utsname.h>
+#include <sys/unistd.h>
+#include <sys/times.h>
+#include <sys/sem.h>
+#include <sys/msg.h>
+#include <sys/ptrace.h>
+#include <sys/signalvar.h>
+



Home | Main Index | Thread Index | Old Index