Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/svr4_32 Add 32-bit svr4 emulation (for 64-bit mac...



details:   https://anonhg.NetBSD.org/src/rev/f20bb25b8b46
branches:  trunk
changeset: 503456:f20bb25b8b46
user:      eeh <eeh%NetBSD.org@localhost>
date:      Tue Feb 06 16:37:56 2001 +0000

description:
Add 32-bit svr4 emulation (for 64-bit machines).

diffstat:

 sys/compat/svr4_32/Makefile              |    14 +
 sys/compat/svr4_32/files.svr4_32         |    27 +
 sys/compat/svr4_32/sed.script            |    43 +
 sys/compat/svr4_32/svr4_32_acl.h         |    50 +
 sys/compat/svr4_32/svr4_32_dirent.h      |    62 +
 sys/compat/svr4_32/svr4_32_exec.c        |    81 +
 sys/compat/svr4_32/svr4_32_exec.h        |    74 +
 sys/compat/svr4_32/svr4_32_exec_elf32.c  |   204 +++
 sys/compat/svr4_32/svr4_32_fcntl.c       |   745 +++++++++++
 sys/compat/svr4_32/svr4_32_fcntl.h       |    79 +
 sys/compat/svr4_32/svr4_32_filio.c       |   119 +
 sys/compat/svr4_32/svr4_32_fuser.h       |    48 +
 sys/compat/svr4_32/svr4_32_hrt.h         |    58 +
 sys/compat/svr4_32/svr4_32_ioctl.c       |   160 ++
 sys/compat/svr4_32/svr4_32_ioctl.h       |    57 +
 sys/compat/svr4_32/svr4_32_ipc.c         |   746 +++++++++++
 sys/compat/svr4_32/svr4_32_ipc.h         |   139 ++
 sys/compat/svr4_32/svr4_32_lwp.c         |   296 ++++
 sys/compat/svr4_32/svr4_32_lwp.h         |    51 +
 sys/compat/svr4_32/svr4_32_misc.c        |  1686 +++++++++++++++++++++++++
 sys/compat/svr4_32/svr4_32_net.c         |   320 ++++
 sys/compat/svr4_32/svr4_32_resource.c    |   290 ++++
 sys/compat/svr4_32/svr4_32_resource.h    |    47 +
 sys/compat/svr4_32/svr4_32_siginfo.h     |    67 +
 sys/compat/svr4_32/svr4_32_signal.c      |   656 +++++++++
 sys/compat/svr4_32/svr4_32_signal.h      |    78 +
 sys/compat/svr4_32/svr4_32_socket.c      |   218 +++
 sys/compat/svr4_32/svr4_32_socket.h      |    51 +
 sys/compat/svr4_32/svr4_32_sockio.c      |   186 ++
 sys/compat/svr4_32/svr4_32_sockio.h      |    72 +
 sys/compat/svr4_32/svr4_32_stat.c        |   891 +++++++++++++
 sys/compat/svr4_32/svr4_32_stat.h        |   103 +
 sys/compat/svr4_32/svr4_32_statvfs.h     |    78 +
 sys/compat/svr4_32/svr4_32_stream.c      |  2007 ++++++++++++++++++++++++++++++
 sys/compat/svr4_32/svr4_32_stropts.h     |   111 +
 sys/compat/svr4_32/svr4_32_syscall.h     |   490 +++++++
 sys/compat/svr4_32/svr4_32_syscallargs.h |   666 +++++++++
 sys/compat/svr4_32/svr4_32_syscalls.c    |   300 ++++
 sys/compat/svr4_32/svr4_32_sysent.c      |   567 ++++++++
 sys/compat/svr4_32/svr4_32_termios.c     |   624 +++++++++
 sys/compat/svr4_32/svr4_32_termios.h     |    59 +
 sys/compat/svr4_32/svr4_32_time.h        |    50 +
 sys/compat/svr4_32/svr4_32_timod.h       |    51 +
 sys/compat/svr4_32/svr4_32_ttold.c       |   387 +++++
 sys/compat/svr4_32/svr4_32_ttold.h       |    48 +
 sys/compat/svr4_32/svr4_32_types.h       |   113 +
 sys/compat/svr4_32/svr4_32_ucontext.h    |    83 +
 sys/compat/svr4_32/svr4_32_ustat.h       |    52 +
 sys/compat/svr4_32/svr4_32_util.h        |    50 +
 sys/compat/svr4_32/syscalls.conf         |    14 +
 sys/compat/svr4_32/syscalls.master       |   414 ++++++
 51 files changed, 13882 insertions(+), 0 deletions(-)

diffs (truncated from 14086 to 300 lines):

diff -r 5e39c139115e -r f20bb25b8b46 sys/compat/svr4_32/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/svr4_32/Makefile       Tue Feb 06 16:37:56 2001 +0000
@@ -0,0 +1,14 @@
+#      $NetBSD: Makefile,v 1.1 2001/02/06 16:37:56 eeh Exp $
+
+DEP=   syscalls.conf syscalls.master ../../kern/makesyscalls.sh
+OBJS=  svr4_32_sysent.c svr4_32_syscalls.c svr4_32_syscall.h svr4_32_syscallargs.h
+
+#syscalls.master: ../svr4/syscalls.master sed.script
+#      sed -f sed.script < ../svr4/syscalls.master > syscalls.master
+
+${OBJS}: ${DEP}
+       -mv -f svr4_32_sysent.c svr4_32_sysent.c.bak
+       -mv -f svr4_32_syscalls.c svr4_32_syscalls.c.bak
+       -mv -f svr4_32_syscall.h svr4_32_syscall.h.bak
+       -mv -f svr4_32_syscallargs.h svr4_32_syscallargs.h.bak
+       sh ../../kern/makesyscalls.sh syscalls.conf syscalls.master
diff -r 5e39c139115e -r f20bb25b8b46 sys/compat/svr4_32/files.svr4_32
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/svr4_32/files.svr4_32  Tue Feb 06 16:37:56 2001 +0000
@@ -0,0 +1,27 @@
+#      $NetBSD: files.svr4_32,v 1.1 2001/02/06 16:37:57 eeh Exp $
+#
+# Config file description for machine-independent SVR4_32 compat code.
+# Included by ports that need it.
+
+# ports should define any machine-specific files they need in their
+# own file lists.
+
+file   compat/svr4_32/svr4_32_exec.c           compat_svr4_32
+file   compat/svr4_32/svr4_32_exec_elf32.c     compat_svr4_32 & exec_elf32
+file   compat/svr4_32/svr4_32_fcntl.c          compat_svr4_32
+#file  compat/svr4_32/svr4_32_filio.c          compat_svr4_32
+file   compat/svr4_32/svr4_32_ioctl.c          compat_svr4_32
+file   compat/svr4_32/svr4_32_ipc.c            compat_svr4_32
+file   compat/svr4_32/svr4_32_lwp.c            compat_svr4_32
+file   compat/svr4_32/svr4_32_misc.c           compat_svr4_32
+file   compat/svr4_32/svr4_32_net.c            compat_svr4_32
+file   compat/svr4_32/svr4_32_resource.c       compat_svr4_32
+file   compat/svr4_32/svr4_32_signal.c         compat_svr4_32
+file   compat/svr4_32/svr4_32_socket.c         compat_svr4_32
+file   compat/svr4_32/svr4_32_sockio.c         compat_svr4_32
+file   compat/svr4_32/svr4_32_stat.c           compat_svr4_32
+file   compat/svr4_32/svr4_32_stream.c         compat_svr4_32
+file   compat/svr4_32/svr4_32_syscalls.c       compat_svr4_32
+file   compat/svr4_32/svr4_32_sysent.c         compat_svr4_32
+file   compat/svr4_32/svr4_32_termios.c        compat_svr4_32
+file   compat/svr4_32/svr4_32_ttold.c          compat_svr4_32
diff -r 5e39c139115e -r f20bb25b8b46 sys/compat/svr4_32/sed.script
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/svr4_32/sed.script     Tue Feb 06 16:37:56 2001 +0000
@@ -0,0 +1,43 @@
+s/svr4/svr4_32/
+s/u_long/netbsd32_u_long/
+s/long/netbsd32_long/
+s/netbsd32_u_netbsd32_long/netbsd32_u_long/
+s/char \*\*/netbsd32_charpp /
+s/char \*/netbsd32_charp /
+s/char\* /netbsd32_charp /
+s/void \*/netbsd32_voidp /
+s/int \*/netbsd32_intp /
+s/svr4_32_time_t \*/svr4_32_time_tp /
+s/caddr_t/netbsd32_caddr_t/
+s/struct svr4_32_stat \*/svr4_32_stat_tp /
+s/struct svr4_32_utimbuf \*/svr4_32_utimbuf_tp /
+s/struct tms \*/svr4_32_tms_tp /
+s/struct svr4_32_strbuf \*/svr4_32_strbuf_tp /
+s/struct pollfd \*/netbsd32_pollfdp_t /
+s/svr4_32_sigset_t \*/svr4_32_sigset_tp /
+s/struct svr4_32_sigaltstack \*/svr4_32_sigaltstack_tp /
+s/struct svr4_32_sigaction \*/svr4_32_sigaction_tp /
+s/struct svr4_32_ucontext \*/svr4_32_ucontext_tp /
+s/struct svr4_32_statvfs \*/svr4_32_statvfs_tp /
+s/union svr4_32_siginfo \*/svr4_32_siginfo_tp /
+s/struct iovec \*/netbsd32_iovecp_t /
+s/struct svr4_32_xstat \*/svr4_32_xstat_tp /
+s/struct svr4_32_rlimit \*/svr4_32_rlimit_tp /
+s/struct svr4_32_utsname\* /svr4_32_utsname_tp /
+s/struct timeval \*/netbsd32_timevalp_t /
+s/struct svr4_32_lwpinfo \*/svr4_32_lwpinfo_tp /
+s/struct itimerval \*/netbsd32_itimervalp_t /
+s/svr4_32_lwpid_t \*/svr4_32_lwpid_tp /
+s/size_t/netbsd32_size_t/
+s/snetbsd32_size_t/netbsd32_ssize_t/
+s/svr4_32_netbsd32_size_t/svr4_32_size_t/
+s/struct svr4_32_aclent \*/svr4_32_aclent_tp /
+s/struct timespec \*/netbsd32_timespecp_t /
+s/struct svr4_32_dirent64 \*/svr4_32_dirent64_tp /
+s/struct svr4_32_stat64 \*/svr4_32_stat64_tp /
+s/struct svr4_32_statvfs64 \*/svr4_32_statvfs64_tp /
+s/struct svr4_32_rlimit64 \*/svr4_32_rlimit64_tp /
+s/struct sockaddr \*/netbsd32_sockaddrp_t /
+s/struct msghdr \*/netbsd32_msghdrp_t /
+s/struct ntptimeval \*/netbsd32_ntptimevalp_t /
+s/struct timex \*/netbsd32_timexp_t /
diff -r 5e39c139115e -r f20bb25b8b46 sys/compat/svr4_32/svr4_32_acl.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/svr4_32/svr4_32_acl.h  Tue Feb 06 16:37:56 2001 +0000
@@ -0,0 +1,50 @@
+/*     $NetBSD: svr4_32_acl.h,v 1.1 2001/02/06 16:37:57 eeh Exp $      */
+
+/*-
+ * Copyright (c) 1996 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        _SVR4_32_ACL_H_
+#define        _SVR4_32_ACL_H_
+
+#include <compat/svr4/svr4_acl.h>
+
+typedef struct svr4_32_aclent {
+       int                     a_type; 
+       svr4_32_uid_t           a_id;
+       svr4_32_o_mode_t        a_perm;
+} svr4_32_aclent_t;
+
+#endif /* !_SVR4_32_ACL_H_ */
diff -r 5e39c139115e -r f20bb25b8b46 sys/compat/svr4_32/svr4_32_dirent.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/svr4_32/svr4_32_dirent.h       Tue Feb 06 16:37:56 2001 +0000
@@ -0,0 +1,62 @@
+/*     $NetBSD: svr4_32_dirent.h,v 1.1 2001/02/06 16:37:57 eeh Exp $    */
+
+/*-
+ * Copyright (c) 1994 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        _SVR4_32_DIRENT_H_
+#define        _SVR4_32_DIRENT_H_
+
+#include <compat/svr4/svr4_dirent.h>
+
+struct svr4_32_dirent {
+       svr4_32_ino_t   d_ino;
+       svr4_32_off_t   d_off;
+       u_short         d_reclen;
+       char            d_name[SVR4_MAXNAMLEN + 1];
+};
+typedef netbsd32_caddr_t svr4_32_dirent_tp;
+
+struct svr4_32_dirent64 {
+       svr4_32_ino64_t d_ino;
+       svr4_32_off64_t d_off;
+       u_short         d_reclen;
+       char            d_name[SVR4_MAXNAMLEN + 1];
+};
+
+#define SVR4_32_NAMEOFF(dp)       ((char *)&(dp)->d_name - (char *)dp)
+#define SVR4_32_RECLEN(de,namlen) ALIGN32((SVR4_32_NAMEOFF(de) + (namlen) + 1))
+
+#endif /* !_SVR4_32_DIRENT_H_ */
diff -r 5e39c139115e -r f20bb25b8b46 sys/compat/svr4_32/svr4_32_exec.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/svr4_32/svr4_32_exec.c Tue Feb 06 16:37:56 2001 +0000
@@ -0,0 +1,81 @@
+/*     $NetBSD: svr4_32_exec.c,v 1.1 2001/02/06 16:37:57 eeh Exp $      */
+
+/*-
+ * Copyright (c) 1994, 2000 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.
+ */
+
+#define        ELFSIZE         32                              /* XXX should die */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+
+#include <machine/svr4_machdep.h>
+
+#include <compat/svr4_32/svr4_32_types.h>
+#include <compat/svr4_32/svr4_32_syscall.h>
+#include <compat/svr4/svr4_errno.h>
+#include <compat/svr4_32/svr4_32_signal.h>
+
+extern char svr4_32_sigcode[], svr4_32_esigcode[];
+extern struct sysent svr4_32_sysent[];
+extern const char * const svr4_32_syscallnames[];
+#ifndef __HAVE_SYSCALL_INTERN
+void syscall __P((void));
+#endif
+
+const struct emul emul_svr4_32 = {
+       "svr4_32",
+       "/emul/svr4_32",
+#ifndef __HAVE_MINIMAL_EMUL
+       0,
+       native_to_svr4_errno,
+       SVR4_32_SYS_syscall,
+       SVR4_32_SYS_MAXSYSCALL,
+#endif
+       svr4_32_sysent,
+       svr4_32_syscallnames,
+       svr4_32_sendsig,
+       svr4_32_sigcode,
+       svr4_32_esigcode,
+       NULL,
+       NULL,
+       NULL,
+#ifdef __HAVE_SYSCALL_INTERN
+       svr4_32_syscall_intern,
+#else
+       syscall,
+#endif



Home | Main Index | Thread Index | Old Index