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 Make SVR4_32 work with the sparc32 versio...



details:   https://anonhg.NetBSD.org/src/rev/dadcd180f675
branches:  trunk
changeset: 534326:dadcd180f675
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jul 22 05:31:18 2002 +0000

description:
Make SVR4_32 work with the sparc32 version of setiathome.  This required
fixing the socket syscall and the SIOGIFCONF ioctl code.

diffstat:

 sys/compat/svr4_32/svr4_32_ioctl.c  |   6 +++---
 sys/compat/svr4_32/svr4_32_socket.c |  23 +++++++++++++++--------
 sys/compat/svr4_32/svr4_32_sockio.c |  16 ++++++++++------
 3 files changed, 28 insertions(+), 17 deletions(-)

diffs (143 lines):

diff -r ef56c3c4a683 -r dadcd180f675 sys/compat/svr4_32/svr4_32_ioctl.c
--- a/sys/compat/svr4_32/svr4_32_ioctl.c        Mon Jul 22 05:23:32 2002 +0000
+++ b/sys/compat/svr4_32/svr4_32_ioctl.c        Mon Jul 22 05:31:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_32_ioctl.c,v 1.6 2001/11/13 02:09:28 lukem Exp $   */
+/*     $NetBSD: svr4_32_ioctl.c,v 1.7 2002/07/22 05:31:18 matt Exp $    */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.6 2001/11/13 02:09:28 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_ioctl.c,v 1.7 2002/07/22 05:31:18 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -116,7 +116,7 @@
 
        svr4_32_decode_cmd(SCARG(uap, com), dir, &c, &num, &argsiz);
 
-       uprintf("svr4_32_ioctl(%d, _IO%s(%c, %d, %d), %p);\n", SCARG(uap, fd),
+       uprintf("svr4_32_ioctl(%d, _IO%s(%c, %d, %d), %#x);\n", SCARG(uap, fd),
            dir, c, num, argsiz, SCARG(uap, data));
 #endif
        fdp = p->p_fd;
diff -r ef56c3c4a683 -r dadcd180f675 sys/compat/svr4_32/svr4_32_socket.c
--- a/sys/compat/svr4_32/svr4_32_socket.c       Mon Jul 22 05:23:32 2002 +0000
+++ b/sys/compat/svr4_32/svr4_32_socket.c       Mon Jul 22 05:31:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_32_socket.c,v 1.2 2001/11/13 02:09:29 lukem Exp $ */
+/*     $NetBSD: svr4_32_socket.c,v 1.3 2002/07/22 05:31:18 matt Exp $  */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.2 2001/11/13 02:09:29 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_socket.c,v 1.3 2002/07/22 05:31:18 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -193,29 +193,36 @@
        register_t *retval;
 {
        struct svr4_32_sys_socket_args *uap = v;
+       struct sys_socket_args uap0;
 
+       /*
+        * We need to use a separate args since native has a different
+        * padding.
+        */
+       SCARG(&uap0, domain) = SCARG(uap, domain);
+       SCARG(&uap0, protocol) = SCARG(uap, protocol);
        switch (SCARG(uap, type)) {
        case SVR4_SOCK_DGRAM:
-               SCARG(uap, type) = SOCK_DGRAM;
+               SCARG(&uap0, type) = SOCK_DGRAM;
                break;
 
        case SVR4_SOCK_STREAM:
-               SCARG(uap, type) = SOCK_STREAM;
+               SCARG(&uap0, type) = SOCK_STREAM;
                break;
 
        case SVR4_SOCK_RAW:
-               SCARG(uap, type) = SOCK_RAW;
+               SCARG(&uap0, type) = SOCK_RAW;
                break;
 
        case SVR4_SOCK_RDM:
-               SCARG(uap, type) = SOCK_RDM;
+               SCARG(&uap0, type) = SOCK_RDM;
                break;
 
        case SVR4_SOCK_SEQPACKET:
-               SCARG(uap, type) = SOCK_SEQPACKET;
+               SCARG(&uap0, type) = SOCK_SEQPACKET;
                break;
        default:
                return EINVAL;
        }
-       return sys_socket(p, uap, retval);
+       return sys_socket(p, &uap0, retval);
 }
diff -r ef56c3c4a683 -r dadcd180f675 sys/compat/svr4_32/svr4_32_sockio.c
--- a/sys/compat/svr4_32/svr4_32_sockio.c       Mon Jul 22 05:23:32 2002 +0000
+++ b/sys/compat/svr4_32/svr4_32_sockio.c       Mon Jul 22 05:31:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svr4_32_sockio.c,v 1.2 2001/11/13 02:09:30 lukem Exp $  */
+/*     $NetBSD: svr4_32_sockio.c,v 1.3 2002/07/22 05:31:18 matt Exp $   */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.2 2001/11/13 02:09:30 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_sockio.c,v 1.3 2002/07/22 05:31:18 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -137,7 +137,7 @@
                        return copyout(&ifnum, data, sizeof(ifnum));
                }
 
-       case SVR4_SIOCGIFFLAGS:
+       case SVR4_32_SIOCGIFFLAGS:
                {
                        struct ifreq br;
                        struct svr4_32_ifreq sr;
@@ -161,9 +161,10 @@
                        return copyout(&sr, data, sizeof(sr));
                }
 
-       case SVR4_SIOCGIFCONF:
+       case SVR4_32_SIOCGIFCONF:
                {
                        struct svr4_32_ifconf sc;
+                       struct ifconf ifc;
 
                        if ((error = copyin(data, &sc, sizeof(sc))) != 0)
                                return error;
@@ -171,10 +172,13 @@
                        DPRINTF(("ifreq %ld svr4_32_ifreq %ld ifc_len %d\n",
                                (unsigned long)sizeof(struct ifreq),
                                (unsigned long)sizeof(struct svr4_32_ifreq),
-                               sc.svr4_ifc_len));
+                               sc.svr4_32_ifc_len));
+
+                       ifc.ifc_len = sc.svr4_32_ifc_len;
+                       ifc.ifc_buf = (caddr_t)(uintptr_t)sc.ifc_ifcu.ifcu_buf;
 
                        if ((error = (*ctl)(fp, OSIOCGIFCONF,
-                                           (caddr_t) &sc, p)) != 0)
+                                           (caddr_t) &ifc, p)) != 0)
                                return error;
 
                        DPRINTF(("SIOCGIFCONF\n"));



Home | Main Index | Thread Index | Old Index