Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Move compat calls, requested by mrg@



details:   https://anonhg.NetBSD.org/src/rev/44146e8d746b
branches:  trunk
changeset: 338986:44146e8d746b
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jun 21 08:47:15 2015 +0000

description:
Move compat calls, requested by mrg@

diffstat:

 sys/compat/netbsd32/netbsd32_compat_50.c |  74 +++++++++++++++++++++++++++++++-
 sys/compat/netbsd32/netbsd32_mqueue.c    |  74 +-------------------------------
 2 files changed, 74 insertions(+), 74 deletions(-)

diffs (185 lines):

diff -r 63373601582c -r 44146e8d746b sys/compat/netbsd32/netbsd32_compat_50.c
--- a/sys/compat/netbsd32/netbsd32_compat_50.c  Sun Jun 21 08:32:36 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_50.c  Sun Jun 21 08:47:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_compat_50.c,v 1.28 2014/10/27 19:10:21 christos Exp $ */
+/*     $NetBSD: netbsd32_compat_50.c,v 1.29 2015/06/21 08:47:15 martin Exp $   */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.28 2014/10/27 19:10:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.29 2015/06/21 08:47:15 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sysv.h"
@@ -1078,3 +1078,73 @@
        NETBSD32TOP_UAP(arg, void *);
        return (compat_50_sys_quotactl(l, &ua, retval));
 }
+
+int
+compat_50_netbsd32_mq_timedsend(struct lwp *l,
+    const struct compat_50_netbsd32_mq_timedsend_args *uap,
+    register_t *retval)
+{
+       /* {
+               syscallarg(mqd_t) mqdes;
+               syscallarg(const netbsd32_charp) msg_ptr;
+               syscallarg(netbsd32_size_t) msg_len;
+               syscallarg(unsigned) msg_prio;
+               syscallarg(const netbsd32_timespec50p_t) abs_timeout;
+       } */
+       struct timespec ts, *tsp;
+       struct netbsd32_timespec50 ts32;
+       int error;
+
+       /* Get and convert time value */
+       if (SCARG_P32(uap, abs_timeout)) {
+               error = copyin(SCARG_P32(uap, abs_timeout), &ts32,
+                    sizeof(ts32));
+               if (error)
+                       return error;
+               netbsd32_to_timespec50(&ts32, &ts);
+               tsp = &ts;
+       } else {
+               tsp = NULL;
+       }
+
+       return mq_send1(SCARG(uap, mqdes), SCARG_P32(uap, msg_ptr),
+           SCARG(uap, msg_len), SCARG(uap, msg_prio), tsp);
+}
+
+int
+compat_50_netbsd32_mq_timedreceive(struct lwp *l,
+    const struct compat_50_netbsd32_mq_timedreceive_args *uap,
+    register_t *retval)
+{
+       /* {
+               syscallarg(mqd_t) mqdes;
+               syscallarg(netbsd32_charp) msg_ptr;
+               syscallarg(netbsd32_size_t) msg_len;
+               syscallarg(netbsd32_uintp) msg_prio;
+               syscallarg(const netbsd32_timespec50p_t) abs_timeout;
+       } */
+       struct timespec ts, *tsp;
+       struct netbsd32_timespec50 ts32;
+       ssize_t mlen;
+       int error;
+
+       /* Get and convert time value */
+       if (SCARG_P32(uap, abs_timeout)) {
+               error = copyin(SCARG_P32(uap, abs_timeout), &ts32,
+                   sizeof(ts32));
+               if (error)
+                       return error;
+               netbsd32_to_timespec50(&ts32, &ts);
+               tsp = &ts;
+       } else {
+               tsp = NULL;
+       }
+
+       error = mq_recv1(SCARG(uap, mqdes), SCARG_P32(uap, msg_ptr),
+           SCARG(uap, msg_len), SCARG_P32(uap, msg_prio), tsp, &mlen);
+       if (error == 0)
+               *retval = mlen;
+
+       return error;
+}
+
diff -r 63373601582c -r 44146e8d746b sys/compat/netbsd32/netbsd32_mqueue.c
--- a/sys/compat/netbsd32/netbsd32_mqueue.c     Sun Jun 21 08:32:36 2015 +0000
+++ b/sys/compat/netbsd32/netbsd32_mqueue.c     Sun Jun 21 08:47:15 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_mqueue.c,v 1.2 2015/06/21 08:32:36 martin Exp $       */
+/*     $NetBSD: netbsd32_mqueue.c,v 1.3 2015/06/21 08:47:15 martin Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mqueue.c,v 1.2 2015/06/21 08:32:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mqueue.c,v 1.3 2015/06/21 08:47:15 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -321,74 +321,4 @@
 
        return error;
 }
- 
-#ifdef COMPAT_50
-int
-compat_50_netbsd32_mq_timedsend(struct lwp *l,
-    const struct compat_50_netbsd32_mq_timedsend_args *uap,
-    register_t *retval)
-{
-       /* {
-               syscallarg(mqd_t) mqdes;
-               syscallarg(const netbsd32_charp) msg_ptr;
-               syscallarg(netbsd32_size_t) msg_len;
-               syscallarg(unsigned) msg_prio;
-               syscallarg(const netbsd32_timespec50p_t) abs_timeout;
-       } */
-       struct timespec ts, *tsp;
-       struct netbsd32_timespec50 ts32;
-       int error;
 
-       /* Get and convert time value */
-       if (SCARG_P32(uap, abs_timeout)) {
-               error = copyin(SCARG_P32(uap, abs_timeout), &ts32,
-                    sizeof(ts32));
-               if (error)
-                       return error;
-               netbsd32_to_timespec50(&ts32, &ts);
-               tsp = &ts;
-       } else {
-               tsp = NULL;
-       }
-
-       return mq_send1(SCARG(uap, mqdes), SCARG_P32(uap, msg_ptr),
-           SCARG(uap, msg_len), SCARG(uap, msg_prio), tsp);
-}
-
-int
-compat_50_netbsd32_mq_timedreceive(struct lwp *l,
-    const struct compat_50_netbsd32_mq_timedreceive_args *uap,
-    register_t *retval)
-{
-       /* {
-               syscallarg(mqd_t) mqdes;
-               syscallarg(netbsd32_charp) msg_ptr;
-               syscallarg(netbsd32_size_t) msg_len;
-               syscallarg(netbsd32_uintp) msg_prio;
-               syscallarg(const netbsd32_timespec50p_t) abs_timeout;
-       } */
-       struct timespec ts, *tsp;
-       struct netbsd32_timespec50 ts32;
-       ssize_t mlen;
-       int error;
-
-       /* Get and convert time value */
-       if (SCARG_P32(uap, abs_timeout)) {
-               error = copyin(SCARG_P32(uap, abs_timeout), &ts32,
-                   sizeof(ts32));
-               if (error)
-                       return error;
-               netbsd32_to_timespec50(&ts32, &ts);
-               tsp = &ts;
-       } else {
-               tsp = NULL;
-       }
-
-       error = mq_recv1(SCARG(uap, mqdes), SCARG_P32(uap, msg_ptr),
-           SCARG(uap, msg_len), SCARG_P32(uap, msg_prio), tsp, &mlen);
-       if (error == 0)
-               *retval = mlen;
-
-       return error;
-}
-#endif



Home | Main Index | Thread Index | Old Index