Module Name: src
Committed By: thorpej
Date: Wed Dec 16 03:07:43 UTC 2020
Modified Files:
src/sys/compat/linux32/arch/amd64 [thorpej-futex]: syscalls.master
src/sys/compat/linux32/common [thorpej-futex]: linux32_misc.c
Log Message:
Add eventfd glue to COMPAT_LINUX32.
To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.71.2.1 \
src/sys/compat/linux32/arch/amd64/syscalls.master
cvs rdiff -u -r1.30 -r1.30.2.1 src/sys/compat/linux32/common/linux32_misc.c
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/linux32/arch/amd64/syscalls.master
diff -u src/sys/compat/linux32/arch/amd64/syscalls.master:1.71 src/sys/compat/linux32/arch/amd64/syscalls.master:1.71.2.1
--- src/sys/compat/linux32/arch/amd64/syscalls.master:1.71 Sun Apr 26 18:53:33 2020
+++ src/sys/compat/linux32/arch/amd64/syscalls.master Wed Dec 16 03:07:43 2020
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.71 2020/04/26 18:53:33 thorpej Exp $
+ $NetBSD: syscalls.master,v 1.71.2.1 2020/12/16 03:07:43 thorpej Exp $
; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
; (See syscalls.conf to see what it is processed into.)
@@ -547,13 +547,14 @@
linux32_timespecp_t times, int flag); }
321 UNIMPL signalfd
322 UNIMPL timerfd_create
-323 UNIMPL eventfd
+323 STD { int|linux32_sys||eventfd(unsigned int initval); }
324 STD { int|linux32_sys||fallocate(int fd, int mode, \
off_t offset, off_t len); }
325 UNIMPL timerfd_settime
326 UNIMPL timerfd_gettime
327 UNIMPL signalfd4
-328 UNIMPL eventfd2
+328 STD { int|linux32_sys||eventfd2(unsigned int initval, \
+ int flags); }
329 UNIMPL epoll_create1
330 STD { int|linux32_sys||dup3(int from, int to, int flags); }
331 STD { int|linux32_sys||pipe2(netbsd32_intp fd, int flags); }
Index: src/sys/compat/linux32/common/linux32_misc.c
diff -u src/sys/compat/linux32/common/linux32_misc.c:1.30 src/sys/compat/linux32/common/linux32_misc.c:1.30.2.1
--- src/sys/compat/linux32/common/linux32_misc.c:1.30 Sun May 3 01:06:56 2020
+++ src/sys/compat/linux32/common/linux32_misc.c Wed Dec 16 03:07:43 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_misc.c,v 1.30 2020/05/03 01:06:56 thorpej Exp $ */
+/* $NetBSD: linux32_misc.c,v 1.30.2.1 2020/12/16 03:07:43 thorpej Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.30 2020/05/03 01:06:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.30.2.1 2020/12/16 03:07:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -352,3 +352,33 @@ linux32_sys_ppoll(struct lwp *l, const s
return pollcommon(retval, SCARG_P32(uap, fds), SCARG(uap, nfds),
ts, sigmask);
}
+
+int
+linux32_sys_eventfd(struct lwp *l, const struct linux32_sys_eventfd_args *uap,
+ register_t *retval)
+{
+ /* {
+ syscallarg(unsigned int) initval;
+ } */
+ struct linux_sys_eventfd_args ua;
+
+ NETBSD32TO64_UAP(initval);
+
+ return linux_sys_eventfd(l, &ua, retval);
+}
+
+int
+linux32_sys_eventfd2(struct lwp *l, const struct linux32_sys_eventfd2_args *uap,
+ register_t *retval)
+{
+ /* {
+ syscallarg(unsigned int) initval;
+ syscallarg(int) flags;
+ } */
+ struct linux_sys_eventfd2_args ua;
+
+ NETBSD32TO64_UAP(initval);
+ NETBSD32TO64_UAP(flags);
+
+ return linux_sys_eventfd2(l, &ua, retval);
+}