Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 always define COMPAT_OLDSOCK (this track...



details:   https://anonhg.NetBSD.org/src/rev/79f1ce280021
branches:  trunk
changeset: 499923:79f1ce280021
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri Dec 01 21:48:24 2000 +0000

description:
always define COMPAT_OLDSOCK (this tracks rev.1.55 of kern/uipc_syscalls.c)
move definition of emul_netbsd32 from netbsd32_exec.c here
fix couple of compile nits I encountered while compiling this with
sparc cross-compiler

diffstat:

 sys/compat/netbsd32/netbsd32_netbsd.c |  59 +++++++++++++++++++++++++++-------
 1 files changed, 46 insertions(+), 13 deletions(-)

diffs (166 lines):

diff -r 2ef6ee4a40e7 -r 79f1ce280021 sys/compat/netbsd32/netbsd32_netbsd.c
--- a/sys/compat/netbsd32/netbsd32_netbsd.c     Fri Dec 01 21:14:42 2000 +0000
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c     Fri Dec 01 21:48:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_netbsd.c,v 1.41 2000/12/01 12:28:34 jdolecek Exp $    */
+/*     $NetBSD: netbsd32_netbsd.c,v 1.42 2000/12/01 21:48:24 jdolecek Exp $    */
 
 /*
  * Copyright (c) 1998 Matthew R. Green
@@ -28,22 +28,24 @@
  * SUCH DAMAGE.
  */
 
+#if defined(_KERNEL) && !defined(_LKM)
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
 #include "opt_ntp.h"
 #include "opt_compat_netbsd.h"
-#include "opt_compat_freebsd.h"
-#include "opt_compat_linux.h"
-#include "opt_compat_sunos.h"
 #include "opt_compat_43.h"
 #include "opt_sysv.h"
-#if defined(COMPAT_43) || defined(COMPAT_SUNOS) || defined(COMPAT_LINUX) || \
-    defined(COMPAT_FREEBSD)
-#define COMPAT_OLDSOCK /* used by <sys/socket.h> */
-#endif
 
 #include "fs_lfs.h"
 #include "fs_nfs.h"
+#endif
+
+/*
+ * Though COMPAT_OLDSOCK is needed only for COMPAT_43, SunOS, Linux,
+ * HP-UX, FreeBSD, Ultrix, OSF1, we define it unconditionally so that
+ * this would be LKM-safe.
+ */
+#define COMPAT_OLDSOCK /* used by <sys/socket.h> */
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -87,6 +89,7 @@
 #include <net/if.h>
 
 #include <compat/netbsd32/netbsd32.h>
+#include <compat/netbsd32/netbsd32_syscall.h>
 #include <compat/netbsd32/netbsd32_syscallargs.h>
 
 #include <machine/frame.h>
@@ -95,6 +98,9 @@
 #include <ddb/ddbvar.h>
 #endif
 
+/* this is provided by kern/kern_exec.c */
+extern int exec_maxhdrsz;
+
 static __inline void netbsd32_from_timeval __P((struct timeval *, struct netbsd32_timeval *));
 static __inline void netbsd32_to_timeval __P((struct netbsd32_timeval *, struct timeval *));
 static __inline void netbsd32_from_itimerval __P((struct itimerval *, struct netbsd32_itimerval *));
@@ -130,6 +136,29 @@
                               int,  off_t *, int, register_t *));
 static int change_utimes32 __P((struct vnode *, struct timeval *, struct proc *));
 
+extern char netbsd32_sigcode[], netbsd32_esigcode[];
+extern struct sysent netbsd32_sysent[];
+#ifdef SYSCALL_DEBUG
+extern const char * const netbsd32_syscallnames[];
+#endif
+
+const struct emul emul_netbsd32 = {
+       "netbsd32",
+       "/emul/netbsd32",
+       NULL,
+       netbsd32_sendsig,
+       netbsd32_SYS_syscall,
+       netbsd32_SYS_MAXSYSCALL,
+       netbsd32_sysent,
+#ifdef SYSCALL_DEBUG
+       netbsd32_syscallnames,
+#else
+       NULL,
+#endif
+       netbsd32_sigcode,
+       netbsd32_esigcode,
+};
+
 /* converters for structures that we need */
 static __inline void
 netbsd32_from_timeval(tv, tv32)
@@ -268,6 +297,7 @@
                iovp->iov_base = (void *)(u_long)iov_base;
                iovp->iov_len = (size_t)iov_len;
        }
+       return error;
 }
 
 /* msg_iov must be done separately */
@@ -580,7 +610,7 @@
        struct sys_exit_args ua;
 
        NETBSD32TO64_UAP(rval);
-       sys_exit(p, &ua, retval);
+       return sys_exit(p, &ua, retval);
 }
 
 int
@@ -1564,6 +1594,7 @@
        return (sys_profil(p, &ua, retval));
 }
 
+#ifdef KTRACE
 int
 netbsd32_ktrace(p, v, retval)
        struct proc *p;
@@ -1584,6 +1615,7 @@
        NETBSD32TO64_UAP(pid);
        return (sys_ktrace(p, &ua, retval));
 }
+#endif /* KTRACE */
 
 int
 netbsd32_sigaction(p, v, retval)
@@ -4094,8 +4126,7 @@
        NETBSD32TOX_UAP(pos, off_t);
        error = sys_mmap(p, &ua, (register_t *)&rt);
        if ((long)rt > (long)UINT_MAX)
-               printf("netbsd32_mmap: retval out of range: 0x%qx",
-                   rt);
+               printf("netbsd32_mmap: retval out of range: %p", rt);
        *retval = (netbsd32_voidp)(u_long)rt;
        return (error);
 }
@@ -5198,7 +5229,7 @@
        int error;
        struct nameidata nd;
        caddr_t sg;
-       char *path;
+       const char *path;
 
        path = (char *)(u_long)SCARG(uap, path);
        sg = stackgap_init(p->p_emul);
@@ -5272,7 +5303,7 @@
        int error;
        struct nameidata nd;
        caddr_t sg;
-       char *path;
+       const char *path;
 
        path = (char *)(u_long)SCARG(uap, path);
        sg = stackgap_init(p->p_emul);
@@ -5399,6 +5430,7 @@
        return (sys_getsid(p, &ua, retval));
 }
 
+#ifdef KTRACE
 int
 netbsd32_fktrace(p, v, retval)
        struct proc *p;
@@ -5419,6 +5451,7 @@
        NETBSD32TO64_UAP(pid);
        return (sys_fktrace(p, &ua, retval));
 }
+#endif /* KTRACE */
 
 int
 netbsd32_preadv(p, v, retval)



Home | Main Index | Thread Index | Old Index