Module Name:    src
Committed By:   christos
Date:           Fri Feb  3 16:18:19 UTC 2017

Modified Files:
        src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h
            linux_syscalls.c linux_sysent.c linux_systrace_args.c
            syscalls.master

Log Message:
add sendmmsg and recvmmsg


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/compat/linux/arch/amd64/linux_syscall.h \
    src/sys/compat/linux/arch/amd64/linux_syscallargs.h \
    src/sys/compat/linux/arch/amd64/linux_syscalls.c \
    src/sys/compat/linux/arch/amd64/linux_sysent.c
cvs rdiff -u -r1.9 -r1.10 \
    src/sys/compat/linux/arch/amd64/linux_systrace_args.c
cvs rdiff -u -r1.59 -r1.60 src/sys/compat/linux/arch/amd64/syscalls.master

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/amd64/linux_syscall.h
diff -u src/sys/compat/linux/arch/amd64/linux_syscall.h:1.65 src/sys/compat/linux/arch/amd64/linux_syscall.h:1.66
--- src/sys/compat/linux/arch/amd64/linux_syscall.h:1.65	Thu Feb  2 10:36:12 2017
+++ src/sys/compat/linux/arch/amd64/linux_syscall.h	Fri Feb  3 11:18:19 2017
@@ -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
 
Index: src/sys/compat/linux/arch/amd64/linux_syscallargs.h
diff -u src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.65 src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.66
--- src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.65	Thu Feb  2 10:36:12 2017
+++ src/sys/compat/linux/arch/amd64/linux_syscallargs.h	Fri Feb  3 11:18:19 2017
@@ -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 @@ struct linux_sys_pipe2_args {
 };
 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_dup3(struct lwp *, const s
 
 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_ */
Index: src/sys/compat/linux/arch/amd64/linux_syscalls.c
diff -u src/sys/compat/linux/arch/amd64/linux_syscalls.c:1.65 src/sys/compat/linux/arch/amd64/linux_syscalls.c:1.66
--- src/sys/compat/linux/arch/amd64/linux_syscalls.c:1.65	Thu Feb  2 10:36:12 2017
+++ src/sys/compat/linux/arch/amd64/linux_syscalls.c	Fri Feb  3 11:18:19 2017
@@ -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 @@ const char *const linux_syscallnames[] =
 	/* 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 @@ const char *const linux_syscallnames[] =
 	/* 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 @@ const char *const altlinux_syscallnames[
 	/* 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 @@ const char *const altlinux_syscallnames[
 	/* 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 */
Index: src/sys/compat/linux/arch/amd64/linux_sysent.c
diff -u src/sys/compat/linux/arch/amd64/linux_sysent.c:1.65 src/sys/compat/linux/arch/amd64/linux_sysent.c:1.66
--- src/sys/compat/linux/arch/amd64/linux_sysent.c:1.65	Thu Feb  2 10:36:12 2017
+++ src/sys/compat/linux/arch/amd64/linux_sysent.c	Fri Feb  3 11:18:19 2017
@@ -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 @@ struct sysent linux_sysent[] = {
 		.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 @@ struct sysent linux_sysent[] = {
 		.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 */

Index: src/sys/compat/linux/arch/amd64/linux_systrace_args.c
diff -u src/sys/compat/linux/arch/amd64/linux_systrace_args.c:1.9 src/sys/compat/linux/arch/amd64/linux_systrace_args.c:1.10
--- src/sys/compat/linux/arch/amd64/linux_systrace_args.c:1.9	Thu Feb  2 10:36:12 2017
+++ src/sys/compat/linux/arch/amd64/linux_systrace_args.c	Fri Feb  3 11:18:19 2017
@@ -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 @@ systrace_args(register_t sysnum, const v
 		*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 @@ systrace_entry_setargdesc(int sysnum, in
 			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 @@ systrace_return_setargdesc(int sysnum, i
 		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:

Index: src/sys/compat/linux/arch/amd64/syscalls.master
diff -u src/sys/compat/linux/arch/amd64/syscalls.master:1.59 src/sys/compat/linux/arch/amd64/syscalls.master:1.60
--- src/sys/compat/linux/arch/amd64/syscalls.master:1.59	Thu Feb  2 10:35:46 2017
+++ src/sys/compat/linux/arch/amd64/syscalls.master	Fri Feb  3 11:18:19 2017
@@ -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

Reply via email to