Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/kern/lib/libsys_linux Add syscall wrapper for mknod...



details:   https://anonhg.NetBSD.org/src/rev/c55a03f20302
branches:  trunk
changeset: 325230:c55a03f20302
user:      njoly <njoly%NetBSD.org@localhost>
date:      Sat Dec 14 10:29:45 2013 +0000

description:
Add syscall wrapper for mknodat(2) to deal with PAD argument difference
between rump and linux versions.

diffstat:

 sys/rump/kern/lib/libsys_linux/Makefile        |   4 +-
 sys/rump/kern/lib/libsys_linux/linux_rump.c    |  45 ++++++++++++++++++++++++++
 sys/rump/kern/lib/libsys_linux/syscalls.master |   6 +-
 3 files changed, 50 insertions(+), 5 deletions(-)

diffs (87 lines):

diff -r 168f063da75f -r c55a03f20302 sys/rump/kern/lib/libsys_linux/Makefile
--- a/sys/rump/kern/lib/libsys_linux/Makefile   Sat Dec 14 10:00:42 2013 +0000
+++ b/sys/rump/kern/lib/libsys_linux/Makefile   Sat Dec 14 10:29:45 2013 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 2013/03/07 18:53:39 pooka Exp $
+#      $NetBSD: Makefile,v 1.3 2013/12/14 10:29:45 njoly Exp $
 #
 
 .PATH: ${.CURDIR}/../../../../compat/linux/common
@@ -10,7 +10,7 @@
        linux_mtio.c linux_signal.c linux_signo.c linux_socket.c        \
        linux_sysctl.c linux_termios.c linux_time.c linux_file64.c
 
-SRCS+= rump_linux_sysent.c component.c
+SRCS+= rump_linux_sysent.c component.c linux_rump.c
 
 # XXX
 CPPFLAGS+= -I${.CURDIR} -I${RUMPTOP}/librump/rumpkern
diff -r 168f063da75f -r c55a03f20302 sys/rump/kern/lib/libsys_linux/linux_rump.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/kern/lib/libsys_linux/linux_rump.c       Sat Dec 14 10:29:45 2013 +0000
@@ -0,0 +1,45 @@
+/*     $NetBSD: linux_rump.c,v 1.1 2013/12/14 10:29:45 njoly Exp $     */
+
+#include <sys/param.h>
+
+#include <compat/linux/common/linux_types.h>
+#include <compat/linux/common/linux_signal.h>
+
+#include "rump_linux_syscallargs.h"
+
+/*
+    compat/linux/arch/.../syscallargs.h and rump_linux_syscallargs.h
+    define the same syscall arguments and prototypes, thus cannot be
+    both used. Just copy needed linux stuff for now to avoid conflicts.
+*/
+
+struct linux_sys_mknodat_args {
+        syscallarg(int) fd;
+        syscallarg(const char *) path;
+        syscallarg(mode_t) mode;
+        syscallarg(unsigned) dev;
+};
+check_syscall_args(linux_sys_mknodat)
+
+int     linux_sys_mknodat(struct lwp *, const struct linux_sys_mknodat_args *, register_t *);
+
+int
+rump_linux_sys_mknodat(struct lwp *l,
+    const struct rump_linux_sys_mknodat_args *uap, register_t *retval)
+{
+       /* {
+               syscallarg(int) fd;
+               syscallarg(const char *) path;
+               syscallarg(mode_t) mode;
+               syscallarg(int) PAD;
+               syscallarg(dev_t) dev;
+       } */
+       struct linux_sys_mknodat_args ua;
+
+       SCARG(&ua, fd) = SCARG(uap, fd);
+       SCARG(&ua, path) = SCARG(uap, path);
+       SCARG(&ua, mode) = SCARG(uap, mode);
+       SCARG(&ua, dev) = SCARG(uap, dev);
+
+       return linux_sys_mknodat(l, &ua, retval);
+}
diff -r 168f063da75f -r c55a03f20302 sys/rump/kern/lib/libsys_linux/syscalls.master
--- a/sys/rump/kern/lib/libsys_linux/syscalls.master    Sat Dec 14 10:00:42 2013 +0000
+++ b/sys/rump/kern/lib/libsys_linux/syscalls.master    Sat Dec 14 10:29:45 2013 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.8 2013/12/08 08:54:48 njoly Exp $
+       $NetBSD: syscalls.master,v 1.9 2013/12/14 10:29:45 njoly Exp $
 
 ;      @(#)syscalls.master     8.2 (Berkeley) 1/13/94
 
@@ -589,8 +589,8 @@
 458    NOARGS          { int|sys||renameat(int fromfd, const char *from, \
                            int tofd, const char *to); }
 459    UNIMPL          mkfifoat
-460    NODEF           { int|linux_sys||mknodat(int fd, const char *path, \
-                           mode_t mode, unsigned dev); }
+460    STD             { int|rump_linux_sys||mknodat(int fd, const char *path, \
+                           mode_t mode, int PAD, unsigned dev); }
 461    NOARGS          { int|sys||mkdirat(int fd, const char *path, \
                            mode_t mode); }
 462    NODEF           { int|linux_sys||faccessat(int fd, const char *path, \



Home | Main Index | Thread Index | Old Index