Source-Changes-HG archive

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

[src/thorpej-futex]: src/sys/compat/linux/common Add Linux eventfd, timerfd, ...



details:   https://anonhg.NetBSD.org/src/rev/a2b51ded80f6
branches:  thorpej-futex
changeset: 982888:a2b51ded80f6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Dec 15 14:07:20 2020 +0000

description:
Add Linux eventfd, timerfd, and POSIX timer calls.

diffstat:

 sys/compat/linux/arch/alpha/syscalls.master   |   31 +-
 sys/compat/linux/arch/amd64/syscalls.master   |   31 +-
 sys/compat/linux/arch/arm/syscalls.master     |   31 +-
 sys/compat/linux/arch/i386/syscalls.master    |   31 +-
 sys/compat/linux/arch/m68k/syscalls.master    |   31 +-
 sys/compat/linux/arch/mips/syscalls.master    |   31 +-
 sys/compat/linux/arch/powerpc/syscalls.master |   31 +-
 sys/compat/linux/common/linux_ioctl.c         |   55 ++--
 sys/compat/linux/common/linux_ioctl.h         |    4 +-
 sys/compat/linux/common/linux_misc.c          |   58 ++++-
 sys/compat/linux/common/linux_sched.h         |   31 ++-
 sys/compat/linux/common/linux_sigevent.h      |    7 +-
 sys/compat/linux/common/linux_signal.c        |   51 ++++-
 sys/compat/linux/common/linux_time.c          |  295 ++++++++++++++++++++++++-
 14 files changed, 590 insertions(+), 128 deletions(-)

diffs (truncated from 1110 to 300 lines):

diff -r 4917b2d31c16 -r a2b51ded80f6 sys/compat/linux/arch/alpha/syscalls.master
--- a/sys/compat/linux/arch/alpha/syscalls.master       Mon Dec 14 16:55:51 2020 +0000
+++ b/sys/compat/linux/arch/alpha/syscalls.master       Tue Dec 15 14:07:20 2020 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.97 2020/04/26 18:53:32 thorpej Exp $
+       $NetBSD: syscalls.master,v 1.97.2.1 2020/12/15 14:07:20 thorpej Exp $
 ;
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -663,11 +663,15 @@
 412    UNIMPL          restart_syscall
 413    STD             { int|linux_sys||fadvise64(int fd, off_t offset, \
                            size_t len, int advice); }
-414    UNIMPL          timer_create
-415    UNIMPL          timer_settime
-416    UNIMPL          timer_gettime
-417    UNIMPL          timer_getoverrun
-418    UNIMPL          timer_delete
+414    STD             { int|linux_sys||timer_create(clockid_t clockid, \
+                           struct linux_sigevent *evp, timer_t *timerid); }
+415    STD             { int|linux_sys||timer_settime(timer_t timerid, \
+                           int flags, const struct linux_itimerspec *tim, \
+                           struct linux_itimerspec *otim); }
+416    STD             { int|linux_sys||timer_gettime(timer_t timerid, \
+                           struct linux_itimerspec *tim); }
+417    NOARGS          { int|sys||timer_getoverrun(timer_t timerid); }
+418    NOARGS          { int|sys||timer_delete(timer_t timerid); }
 419    STD             { int|linux_sys||clock_settime(clockid_t which, \
                            struct linux_timespec *tp); }
 420    STD             { int|linux_sys||clock_gettime(clockid_t which, \
@@ -760,17 +764,22 @@
                            struct linux_timespec *times, int flag); }
 476    UNIMPL          signalfd
 477    UNIMPL          timerfd
-478    UNIMPL          eventfd
+478    STD             { int|linux_sys||eventfd(unsigned int initval); }
 479    STD             { int|linux_sys||recvmmsg(int s, \
                            struct linux_mmsghdr *msgvec, unsigned int vlen, \
                            unsigned int flags, struct timespec *timeout); }
 480    STD             { int|linux_sys||fallocate(int fd, int mode, \
                            off_t offset, off_t len); }
-481    UNIMPL          timerfd_create
-482    UNIMPL          timerfd_settime
-483    UNIMPL          timerfd_gettime
+481    STD             { int|linux_sys||timerfd_create(clockid_t clock_id, \
+                           int flags); }
+482    STD             { int|linux_sys||timerfd_settime(int fd, int flags, \
+                           const struct linux_itimerspec *new_value, \
+                           struct linux_itimerspec *old_value); }
+483    STD             { int|linux_sys||timerfd_gettime(int fd, \
+                           struct linux_itimerspec *curr_value); }
 484    UNIMPL          signalfd4
-485    UNIMPL          eventfd2
+485    STD             { int|linux_sys||eventfd2(unsigned int initval, \
+                           int flags); }
 486    UNIMPL          epoll_create1
 487    STD             { int|linux_sys||dup3(int from, int to, int flags); }
 488    STD             { int|linux_sys||pipe2(int *pfds, int flags); }
diff -r 4917b2d31c16 -r a2b51ded80f6 sys/compat/linux/arch/amd64/syscalls.master
--- a/sys/compat/linux/arch/amd64/syscalls.master       Mon Dec 14 16:55:51 2020 +0000
+++ b/sys/compat/linux/arch/amd64/syscalls.master       Tue Dec 15 14:07:20 2020 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.62 2020/04/26 18:53:32 thorpej Exp $
+       $NetBSD: syscalls.master,v 1.62.2.1 2020/12/15 14:07:20 thorpej Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -423,11 +423,15 @@
 220    UNIMPL          semtimedop
 221    STD             { int|linux_sys||fadvise64(int fd, off_t offset, \
                            size_t len, int advice); }
-222    UNIMPL          timer_create
-223    UNIMPL          timer_settime
-224    UNIMPL          timer_gettime
-225    UNIMPL          timer_getoverrun
-226    UNIMPL          timer_delete
+222    STD             { int|linux_sys||timer_create(clockid_t clockid, \
+                           struct linux_sigevent *evp, timer_t *timerid); }
+223    STD             { int|linux_sys||timer_settime(timer_t timerid, \
+                           int flags, const struct linux_itimerspec *tim, \
+                           struct linux_itimerspec *otim); }
+224    STD             { int|linux_sys||timer_gettime(timer_t timerid, \
+                           struct linux_itimerspec *tim); }
+225    NOARGS          { int|sys||timer_getoverrun(timer_t timerid); }
+226    NOARGS          { int|sys||timer_delete(timer_t timerid); }
 227    STD             { int|linux_sys||clock_settime(clockid_t which, \
                            struct linux_timespec *tp); }
 228    STD             { int|linux_sys||clock_gettime(clockid_t which, \
@@ -515,17 +519,22 @@
                            struct linux_timespec *times, int flag); }
 281    UNIMPL          epoll_pwait
 282    UNIMPL          signalfd
-283    UNIMPL          timerfd_create
-284    UNIMPL          eventfd
+283    STD             { int|linux_sys||timerfd_create(clockid_t clock_id, \
+                           int flags); }
+284    STD             { int|linux_sys||eventfd(unsigned int initval); }
 285    STD             { int|linux_sys||fallocate(int fd, int mode, \
                            off_t offset, off_t len); }
-286    UNIMPL          timerfd_settime
-287    UNIMPL          timerfd_gettime
+286    STD             { int|linux_sys||timerfd_settime(int fd, int flags, \
+                           const struct linux_itimerspec *new_value, \
+                           struct linux_itimerspec *old_value); }
+287    STD             { int|linux_sys||timerfd_gettime(int fd, \
+                           struct linux_itimerspec *curr_value); }
 288    STD             { int|linux_sys||accept4(int s, \
                            struct osockaddr *name, \
                            int *anamelen, int flags); }
 289    UNIMPL          signalfd4
-290    UNIMPL          eventfd2
+290    STD             { int|linux_sys||eventfd2(unsigned int initval, \
+                           int flags); }
 291    UNIMPL          epoll_create1
 292    STD             { int|linux_sys||dup3(int from, int to, int flags); }
 293    STD             { int|linux_sys||pipe2(int *pfds, int flags); }
diff -r 4917b2d31c16 -r a2b51ded80f6 sys/compat/linux/arch/arm/syscalls.master
--- a/sys/compat/linux/arch/arm/syscalls.master Mon Dec 14 16:55:51 2020 +0000
+++ b/sys/compat/linux/arch/arm/syscalls.master Tue Dec 15 14:07:20 2020 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.69 2020/04/26 18:53:32 thorpej Exp $
+       $NetBSD: syscalls.master,v 1.69.2.1 2020/12/15 14:07:21 thorpej Exp $
 
 ; Derived from sys/compat/linux/arch/*/syscalls.master
 ; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -431,11 +431,15 @@
 254    UNIMPL          set_thread_area
 255    UNIMPL          get_thread_area
 256    STD             { int|linux_sys||set_tid_address(int *tid); }
-257    UNIMPL          timer_create
-258    UNIMPL          timer_settime
-259    UNIMPL          timer_gettime
-260    UNIMPL          timer_getoverrun
-261    UNIMPL          timer_delete
+257    STD             { int|linux_sys||timer_create(clockid_t clockid, \
+                           struct linux_sigevent *evp, timer_t *timerid); }
+258    STD             { int|linux_sys||timer_settime(timer_t timerid, \
+                           int flags, const struct linux_itimerspec *tim, \
+                           struct linux_itimerspec *otim); }
+259    STD             { int|linux_sys||timer_gettime(timer_t timerid, \
+                           struct linux_itimerspec *tim); }
+260    NOARGS          { int|sys||timer_getoverrun(timer_t timerid); }
+261    NOARGS          { int|sys||timer_delete(timer_t timerid); }
 262    STD             { int|linux_sys||clock_settime(clockid_t which, \
                            struct linux_timespec *tp); }
 263    STD             { int|linux_sys||clock_gettime(clockid_t which, \
@@ -558,14 +562,19 @@
 348    STD             { int|linux_sys||utimensat(int fd, const char *path, \
                            struct linux_timespec *times, int flag); }
 349    UNIMPL          signalfd
-350    UNIMPL          timerfd_create
-351    UNIMPL          eventfd
+350    STD             { int|linux_sys||timerfd_create(clockid_t clock_id, \
+                           int flags); }
+351    STD             { int|linux_sys||eventfd(unsigned int initval); }
 352    STD             { int|linux_sys||fallocate(int fd, int mode, \
                            off_t offset, off_t len); }
-353    UNIMPL          timerfd_settime
-354    UNIMPL          timerfd_gettime
+353    STD             { int|linux_sys||timerfd_settime(int fd, int flags, \
+                           const struct linux_itimerspec *new_value, \
+                           struct linux_itimerspec *old_value); }
+354    STD             { int|linux_sys||timerfd_gettime(int fd, \
+                           struct linux_itimerspec *curr_value); }
 355    UNIMPL          signalfd4
-356    UNIMPL          eventfd2
+356    STD             { int|linux_sys||eventfd2(unsigned int initval, \
+                           int flags); }
 357    UNIMPL          epoll_create1
 358    STD             { int|linux_sys||dup3(int from, int to, int flags); }
 359    STD             { int|linux_sys||pipe2(int *pfds, int flags); }
diff -r 4917b2d31c16 -r a2b51ded80f6 sys/compat/linux/arch/i386/syscalls.master
--- a/sys/compat/linux/arch/i386/syscalls.master        Mon Dec 14 16:55:51 2020 +0000
+++ b/sys/compat/linux/arch/i386/syscalls.master        Tue Dec 15 14:07:20 2020 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.124 2020/04/26 18:53:32 thorpej Exp $
+       $NetBSD: syscalls.master,v 1.124.2.1 2020/12/15 14:07:21 thorpej Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -433,11 +433,15 @@
 256    UNIMPL          epoll_wait
 257    UNIMPL          remap_file_pages
 258    STD             { int|linux_sys||set_tid_address(int *tid); }
-259    UNIMPL          timer_create
-260    UNIMPL          timer_settime
-261    UNIMPL          timer_gettime
-262    UNIMPL          timer_getoverrun
-263    UNIMPL          timer_delete
+259    STD             { int|linux_sys||timer_create(clockid_t clockid, \
+                           struct linux_sigevent *evp, timer_t *timerid); }
+260    STD             { int|linux_sys||timer_settime(timer_t timerid, \
+                           int flags, const struct linux_itimerspec *tim, \
+                           struct linux_itimerspec *otim); }
+261    STD             { int|linux_sys||timer_gettime(timer_t timerid, \
+                           struct linux_itimerspec *tim); }
+262    NOARGS          { int|sys||timer_getoverrun(timer_t timerid); }
+263    NOARGS          { int|sys||timer_delete(timer_t timerid); }
 264    STD             { int|linux_sys||clock_settime(clockid_t which, \
                            struct linux_timespec *tp); }
 265    STD             { int|linux_sys||clock_gettime(clockid_t which, \
@@ -525,14 +529,19 @@
 320    STD             { int|linux_sys||utimensat(int fd, const char *path, \
                            struct linux_timespec *times, int flag); }
 321    UNIMPL          signalfd
-322    UNIMPL          timerfd_create
-323    UNIMPL          eventfd
+322    STD             { int|linux_sys||timerfd_create(clockid_t clock_id, \
+                           int flags); }
+323    STD             { int|linux_sys||eventfd(unsigned int initval); }
 324    STD             { int|linux_sys||fallocate(int fd, int mode, \
                            off_t offset, off_t len); }
-325    UNIMPL          timerfd_settime
-326    UNIMPL          timerfd_gettime
+325    STD             { int|linux_sys||timerfd_settime(int fd, int flags, \
+                           const struct linux_itimerspec *new_value, \
+                           struct linux_itimerspec *old_value); }
+326    STD             { int|linux_sys||timerfd_gettime(int fd, \
+                           struct linux_itimerspec *curr_value); }
 327    UNIMPL          signalfd4
-328    UNIMPL          eventfd2
+328    STD             { int|linux_sys||eventfd2(unsigned int initval, \
+                           int flags); }
 329    UNIMPL          epoll_create1
 330     STD             { int|linux_sys||dup3(int from, int to, int flags); }
 331     STD             { int|linux_sys||pipe2( int *pfds, int flags); }
diff -r 4917b2d31c16 -r a2b51ded80f6 sys/compat/linux/arch/m68k/syscalls.master
--- a/sys/compat/linux/arch/m68k/syscalls.master        Mon Dec 14 16:55:51 2020 +0000
+++ b/sys/compat/linux/arch/m68k/syscalls.master        Tue Dec 15 14:07:20 2020 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.95 2020/04/26 18:53:32 thorpej Exp $
+       $NetBSD: syscalls.master,v 1.95.2.1 2020/12/15 14:07:21 thorpej Exp $
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -443,11 +443,15 @@
 251    UNIMPL          epoll_wait
 252    UNIMPL          remap_file_pages
 253    STD             { int|linux_sys||set_tid_address(int *tid); }
-254    UNIMPL          timer_create
-255    UNIMPL          timer_settime
-256    UNIMPL          timer_gettime
-257    UNIMPL          timer_getoverrun
-258    UNIMPL          timer_ delete
+254    STD             { int|linux_sys||timer_create(clockid_t clockid, \
+                           struct linux_sigevent *evp, timer_t *timerid); }
+255    STD             { int|linux_sys||timer_settime(timer_t timerid, \
+                           int flags, const struct linux_itimerspec *tim, \
+                           struct linux_itimerspec *otim); }
+256    STD             { int|linux_sys||timer_gettime(timer_t timerid, \
+                           struct linux_itimerspec *tim); }
+257    NOARGS          { int|sys||timer_getoverrun(timer_t timerid); }
+258    NOARGS          { int|sys||timer_delete(timer_t timerid); }
 259    STD             { int|linux_sys||clock_settime(clockid_t which, \
                            struct linux_timespec *tp); }
 260    STD             { int|linux_sys||clock_gettime(clockid_t which, \
@@ -543,14 +547,19 @@
 316    STD             { int|linux_sys||utimensat(int fd, const char *path, \
                            struct linux_timespec *times, int flag); }
 317    UNIMPL          signalfd
-318    UNIMPL          timerfd_create
-319    UNIMPL          eventfd
+318    STD             { int|linux_sys||timerfd_create(clockid_t clock_id, \
+                           int flags); }
+319    STD             { int|linux_sys||eventfd(unsigned int initval); }
 320    STD             { int|linux_sys||fallocate(int fd, int mode, \
                            off_t offset, off_t len); }
-321    UNIMPL          timerfd_settime
-322    UNIMPL          timerfd_gettime
+321    STD             { int|linux_sys||timerfd_settime(int fd, int flags, \
+                           const struct linux_itimerspec *new_value, \
+                           struct linux_itimerspec *old_value); }
+322    STD             { int|linux_sys||timerfd_gettime(int fd, \
+                           struct linux_itimerspec *curr_value); }
 323    UNIMPL          signalfd4
-324    UNIMPL          eventfd2
+324    STD             { int|linux_sys||eventfd2(unsigned int initval, \
+                           int flags); }
 325    UNIMPL          epoll_create1
 326    STD             { int|linux_sys||dup3(int from, int to, int flags); }
 327    STD             { int|linux_sys||pipe2(int *pfds, int flags); }
diff -r 4917b2d31c16 -r a2b51ded80f6 sys/compat/linux/arch/mips/syscalls.master
--- a/sys/compat/linux/arch/mips/syscalls.master        Mon Dec 14 16:55:51 2020 +0000
+++ b/sys/compat/linux/arch/mips/syscalls.master        Tue Dec 15 14:07:20 2020 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.68 2020/04/26 18:53:32 thorpej Exp $  
+       $NetBSD: syscalls.master,v 1.68.2.1 2020/12/15 14:07:21 thorpej Exp $  
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -439,11 +439,15 @@
                            size_t sz, struct linux_statfs64 *sp); }
 256    STD             { int|linux_sys||fstatfs64(int fd, \
                            size_t sz, struct linux_statfs64 *sp); }
-257    UNIMPL          timer_create
-258    UNIMPL          timer_settime
-259    UNIMPL          timer_gettime
-260    UNIMPL          timer_getoverrun
-261    UNIMPL          timer_delete
+257    STD             { int|linux_sys||timer_create(clockid_t clockid, \



Home | Main Index | Thread Index | Old Index