Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux/arch/amd64 add sendmmsg and recvmmsg



details:   https://anonhg.NetBSD.org/src/rev/b7697eb2e010
branches:  trunk
changeset: 821390:b7697eb2e010
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Feb 03 16:18:19 2017 +0000

description:
add sendmmsg and recvmmsg

diffstat:

 sys/compat/linux/arch/amd64/linux_syscall.h       |   8 ++-
 sys/compat/linux/arch/amd64/linux_syscallargs.h   |  23 ++++++-
 sys/compat/linux/arch/amd64/linux_syscalls.c      |  12 +-
 sys/compat/linux/arch/amd64/linux_sysent.c        |  16 +++-
 sys/compat/linux/arch/amd64/linux_systrace_args.c |  74 ++++++++++++++++++++++-
 sys/compat/linux/arch/amd64/syscalls.master       |  10 ++-
 6 files changed, 125 insertions(+), 18 deletions(-)

diffs (297 lines):

diff -r 57eb98407adf -r b7697eb2e010 sys/compat/linux/arch/amd64/linux_syscall.h
--- a/sys/compat/linux/arch/amd64/linux_syscall.h       Fri Feb 03 16:17:17 2017 +0000
+++ b/sys/compat/linux/arch/amd64/linux_syscall.h       Fri Feb 03 16:18:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscall.h,v 1.65 2017/02/02 15:36:12 christos Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.66 2017/02/03 16:18:19 christos Exp $ */
 
 /*
  * System call numbers.
@@ -654,6 +654,12 @@
 /* syscall: "pipe2" ret: "int" args: "int *" "int" */
 #define        LINUX_SYS_pipe2 293
 
+/* syscall: "recvmmsg" ret: "int" args: "int" "struct linux_mmsghdr *" "unsigned int" "unsigned int" "struct timespec *" */
+#define        LINUX_SYS_recvmmsg      299
+
+/* syscall: "sendmmsg" ret: "int" args: "int" "struct linux_mmsghdr *" "unsigned int" "unsigned int" */
+#define        LINUX_SYS_sendmmsg      307
+
 /* syscall: "nosys" ret: "int" args: */
 #define        LINUX_SYS_nosys 314
 
diff -r 57eb98407adf -r b7697eb2e010 sys/compat/linux/arch/amd64/linux_syscallargs.h
--- a/sys/compat/linux/arch/amd64/linux_syscallargs.h   Fri Feb 03 16:17:17 2017 +0000
+++ b/sys/compat/linux/arch/amd64/linux_syscallargs.h   Fri Feb 03 16:18:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscallargs.h,v 1.65 2017/02/02 15:36:12 christos Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.66 2017/02/03 16:18:19 christos Exp $ */
 
 /*
  * System call argument lists.
@@ -1025,6 +1025,23 @@
 };
 check_syscall_args(linux_sys_pipe2)
 
+struct linux_sys_recvmmsg_args {
+       syscallarg(int) s;
+       syscallarg(struct linux_mmsghdr *) msgvec;
+       syscallarg(unsigned int) vlen;
+       syscallarg(unsigned int) flags;
+       syscallarg(struct timespec *) timeout;
+};
+check_syscall_args(linux_sys_recvmmsg)
+
+struct linux_sys_sendmmsg_args {
+       syscallarg(int) s;
+       syscallarg(struct linux_mmsghdr *) msgvec;
+       syscallarg(unsigned int) vlen;
+       syscallarg(unsigned int) flags;
+};
+check_syscall_args(linux_sys_sendmmsg)
+
 /*
  * System call prototypes.
  */
@@ -1462,6 +1479,10 @@
 
 int    linux_sys_pipe2(struct lwp *, const struct linux_sys_pipe2_args *, register_t *);
 
+int    linux_sys_recvmmsg(struct lwp *, const struct linux_sys_recvmmsg_args *, register_t *);
+
+int    linux_sys_sendmmsg(struct lwp *, const struct linux_sys_sendmmsg_args *, register_t *);
+
 int    linux_sys_nosys(struct lwp *, const void *, register_t *);
 
 #endif /* _LINUX_SYS_SYSCALLARGS_H_ */
diff -r 57eb98407adf -r b7697eb2e010 sys/compat/linux/arch/amd64/linux_syscalls.c
--- a/sys/compat/linux/arch/amd64/linux_syscalls.c      Fri Feb 03 16:17:17 2017 +0000
+++ b/sys/compat/linux/arch/amd64/linux_syscalls.c      Fri Feb 03 16:18:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscalls.c,v 1.65 2017/02/02 15:36:12 christos Exp $ */
+/* $NetBSD: linux_syscalls.c,v 1.66 2017/02/03 16:18:19 christos Exp $ */
 
 /*
  * System call names.
@@ -8,7 +8,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.65 2017/02/02 15:36:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_syscalls.c,v 1.66 2017/02/03 16:18:19 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
@@ -365,7 +365,7 @@
        /* 296 */       "#296 (unimplemented pwritev)",
        /* 297 */       "#297 (unimplemented rt_tgsigqueueinfo)",
        /* 298 */       "#298 (unimplemented perf_counter_open)",
-       /* 299 */       "#299 (unimplemented recvmmsg)",
+       /* 299 */       "recvmmsg",
        /* 300 */       "#300 (unimplemented fanotify_init)",
        /* 301 */       "#301 (unimplemented fanotify_mark)",
        /* 302 */       "#302 (unimplemented prlimit64)",
@@ -373,7 +373,7 @@
        /* 304 */       "#304 (unimplemented open_by_handle_at)",
        /* 305 */       "#305 (unimplemented clock_adjtime)",
        /* 306 */       "#306 (unimplemented syncfs)",
-       /* 307 */       "#307 (unimplemented sendmmsg)",
+       /* 307 */       "sendmmsg",
        /* 308 */       "#308 (unimplemented setns)",
        /* 309 */       "#309 (unimplemented getcpu)",
        /* 310 */       "#310 (unimplemented process_vm_readv)",
@@ -909,7 +909,7 @@
        /* 296 */       NULL, /* unimplemented pwritev */
        /* 297 */       NULL, /* unimplemented rt_tgsigqueueinfo */
        /* 298 */       NULL, /* unimplemented perf_counter_open */
-       /* 299 */       NULL, /* unimplemented recvmmsg */
+       /* 299 */       NULL, /* recvmmsg */
        /* 300 */       NULL, /* unimplemented fanotify_init */
        /* 301 */       NULL, /* unimplemented fanotify_mark */
        /* 302 */       NULL, /* unimplemented prlimit64 */
@@ -917,7 +917,7 @@
        /* 304 */       NULL, /* unimplemented open_by_handle_at */
        /* 305 */       NULL, /* unimplemented clock_adjtime */
        /* 306 */       NULL, /* unimplemented syncfs */
-       /* 307 */       NULL, /* unimplemented sendmmsg */
+       /* 307 */       NULL, /* sendmmsg */
        /* 308 */       NULL, /* unimplemented setns */
        /* 309 */       NULL, /* unimplemented getcpu */
        /* 310 */       NULL, /* unimplemented process_vm_readv */
diff -r 57eb98407adf -r b7697eb2e010 sys/compat/linux/arch/amd64/linux_sysent.c
--- a/sys/compat/linux/arch/amd64/linux_sysent.c        Fri Feb 03 16:17:17 2017 +0000
+++ b/sys/compat/linux/arch/amd64/linux_sysent.c        Fri Feb 03 16:18:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_sysent.c,v 1.65 2017/02/02 15:36:12 christos Exp $ */
+/* $NetBSD: linux_sysent.c,v 1.66 2017/02/03 16:18:19 christos Exp $ */
 
 /*
  * System call switch table.
@@ -8,7 +8,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.65 2017/02/02 15:36:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sysent.c,v 1.66 2017/02/03 16:18:19 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sysv.h"
@@ -1326,8 +1326,10 @@
                .sy_call = linux_sys_nosys,
        },              /* 298 = filler */
        {
-               .sy_call = linux_sys_nosys,
-       },              /* 299 = filler */
+               ns(struct linux_sys_recvmmsg_args),
+               .sy_flags = SYCALL_ARG_PTR,
+               .sy_call = (sy_call_t *)linux_sys_recvmmsg
+       },              /* 299 = recvmmsg */
        {
                .sy_call = linux_sys_nosys,
        },              /* 300 = filler */
@@ -1350,8 +1352,10 @@
                .sy_call = linux_sys_nosys,
        },              /* 306 = filler */
        {
-               .sy_call = linux_sys_nosys,
-       },              /* 307 = filler */
+               ns(struct linux_sys_sendmmsg_args),
+               .sy_flags = SYCALL_ARG_PTR,
+               .sy_call = (sy_call_t *)linux_sys_sendmmsg
+       },              /* 307 = sendmmsg */
        {
                .sy_call = linux_sys_nosys,
        },              /* 308 = filler */
diff -r 57eb98407adf -r b7697eb2e010 sys/compat/linux/arch/amd64/linux_systrace_args.c
--- a/sys/compat/linux/arch/amd64/linux_systrace_args.c Fri Feb 03 16:17:17 2017 +0000
+++ b/sys/compat/linux/arch/amd64/linux_systrace_args.c Fri Feb 03 16:18:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_systrace_args.c,v 1.9 2017/02/02 15:36:12 christos Exp $ */
+/* $NetBSD: linux_systrace_args.c,v 1.10 2017/02/03 16:18:19 christos Exp $ */
 
 /*
  * System call argument to DTrace register array converstion.
@@ -1770,6 +1770,27 @@
                *n_args = 2;
                break;
        }
+       /* linux_sys_recvmmsg */
+       case 299: {
+               const struct linux_sys_recvmmsg_args *p = params;
+               iarg[0] = SCARG(p, s); /* int */
+               uarg[1] = (intptr_t) SCARG(p, msgvec); /* struct linux_mmsghdr * */
+               uarg[2] = SCARG(p, vlen); /* unsigned int */
+               uarg[3] = SCARG(p, flags); /* unsigned int */
+               uarg[4] = (intptr_t) SCARG(p, timeout); /* struct timespec * */
+               *n_args = 5;
+               break;
+       }
+       /* linux_sys_sendmmsg */
+       case 307: {
+               const struct linux_sys_sendmmsg_args *p = params;
+               iarg[0] = SCARG(p, s); /* int */
+               uarg[1] = (intptr_t) SCARG(p, msgvec); /* struct linux_mmsghdr * */
+               uarg[2] = SCARG(p, vlen); /* unsigned int */
+               uarg[3] = SCARG(p, flags); /* unsigned int */
+               *n_args = 4;
+               break;
+       }
        /* linux_sys_nosys */
        case 314: {
                *n_args = 0;
@@ -4714,6 +4735,47 @@
                        break;
                };
                break;
+       /* linux_sys_recvmmsg */
+       case 299:
+               switch(ndx) {
+               case 0:
+                       p = "int";
+                       break;
+               case 1:
+                       p = "struct linux_mmsghdr *";
+                       break;
+               case 2:
+                       p = "unsigned int";
+                       break;
+               case 3:
+                       p = "unsigned int";
+                       break;
+               case 4:
+                       p = "struct timespec *";
+                       break;
+               default:
+                       break;
+               };
+               break;
+       /* linux_sys_sendmmsg */
+       case 307:
+               switch(ndx) {
+               case 0:
+                       p = "int";
+                       break;
+               case 1:
+                       p = "struct linux_mmsghdr *";
+                       break;
+               case 2:
+                       p = "unsigned int";
+                       break;
+               case 3:
+                       p = "unsigned int";
+                       break;
+               default:
+                       break;
+               };
+               break;
        /* linux_sys_nosys */
        case 314:
                break;
@@ -5740,6 +5802,16 @@
                if (ndx == 0 || ndx == 1)
                        p = "int";
                break;
+       /* linux_sys_recvmmsg */
+       case 299:
+               if (ndx == 0 || ndx == 1)
+                       p = "int";
+               break;
+       /* linux_sys_sendmmsg */
+       case 307:
+               if (ndx == 0 || ndx == 1)
+                       p = "int";
+               break;
        /* linux_sys_nosys */
        case 314:
        default:
diff -r 57eb98407adf -r b7697eb2e010 sys/compat/linux/arch/amd64/syscalls.master
--- a/sys/compat/linux/arch/amd64/syscalls.master       Fri Feb 03 16:17:17 2017 +0000
+++ b/sys/compat/linux/arch/amd64/syscalls.master       Fri Feb 03 16:18:19 2017 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.59 2017/02/02 15:35:46 christos Exp $
+       $NetBSD: syscalls.master,v 1.60 2017/02/03 16:18:19 christos Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -529,7 +529,9 @@
 296    UNIMPL          pwritev
 297    UNIMPL          rt_tgsigqueueinfo
 298    UNIMPL          perf_counter_open
-299    UNIMPL          recvmmsg
+299    STD             { int|linux_sys||recvmmsg(int s, \
+                           struct linux_mmsghdr *msgvec, unsigned int vlen, \
+                           unsigned int flags, struct timespec *timeout); }
 300    UNIMPL          fanotify_init
 301    UNIMPL          fanotify_mark
 302    UNIMPL          prlimit64
@@ -537,7 +539,9 @@
 304    UNIMPL          open_by_handle_at
 305    UNIMPL          clock_adjtime
 306    UNIMPL          syncfs
-307    UNIMPL          sendmmsg
+307    STD             { int|linux_sys||sendmmsg(int s, \
+                           struct linux_mmsghdr *msgvec, unsigned int vlen, \
+                           unsigned int flags); }
 308    UNIMPL          setns
 309    UNIMPL          getcpu
 310    UNIMPL          process_vm_readv



Home | Main Index | Thread Index | Old Index