Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump * move stat syscalls to newstyle compat



details:   https://anonhg.NetBSD.org/src/rev/7c08a6030ddf
branches:  trunk
changeset: 756483:7c08a6030ddf
user:      pooka <pooka%NetBSD.org@localhost>
date:      Mon Jul 19 15:33:16 2010 +0000

description:
* move stat syscalls to newstyle compat
* implement compat for pollts

diffstat:

 sys/rump/librump/rumpkern/Makefile.rumpkern |   3 +-
 sys/rump/librump/rumpkern/compat.c          |  86 +++++++++++++++++++++++++++++
 sys/rump/librump/rumpvfs/compat.c           |  13 +++-
 3 files changed, 97 insertions(+), 5 deletions(-)

diffs (176 lines):

diff -r c8e630a2e676 -r 7c08a6030ddf sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Mon Jul 19 15:30:43 2010 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Mon Jul 19 15:33:16 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpkern,v 1.91 2010/06/16 11:45:21 pooka Exp $
+#      $NetBSD: Makefile.rumpkern,v 1.92 2010/07/19 15:33:16 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -18,6 +18,7 @@
 SRCS=  rump.c rumpcopy.c emul.c intr.c klock.c kobj_rename.c   \
        ltsleep.c memalloc.c scheduler.c signals.c sleepq.c     \
        sysproxy_socket.c threads.c vm.c
+SRCS+= compat.c
 
 # Multiprocessor or uniprocessor locking.  TODO: select right
 # locking at runtime.
diff -r c8e630a2e676 -r 7c08a6030ddf sys/rump/librump/rumpkern/compat.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/librump/rumpkern/compat.c        Mon Jul 19 15:33:16 2010 +0000
@@ -0,0 +1,86 @@
+/*     $NetBSD: compat.c,v 1.1 2010/07/19 15:33:16 pooka Exp $ */
+
+/*-
+ * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: compat.c,v 1.1 2010/07/19 15:33:16 pooka Exp $");
+
+#include <sys/param.h>
+#include <sys/kmem.h>
+#include <sys/poll.h>
+#include <sys/sched.h>
+#include <sys/syscallargs.h>
+#include <sys/vnode.h>
+
+#include <compat/sys/time.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls_compat.h>
+#include <rump/rumpuser.h>
+
+/* mostly from sys/common/compat/kern_time_50.c */
+
+int
+rump_sys_nb5_pollts(struct pollfd *fds, size_t nfds,
+       const struct timespec *tsarg, const void *sigset)
+{
+       register_t retval;
+       struct timespec ats, *ts = NULL;
+       struct timespec50 ats50;
+       sigset_t        amask, *mask = NULL;
+       int             error;
+
+       rump_schedule();
+
+       if (tsarg) {
+               error = copyin(tsarg, &ats50, sizeof(ats50));
+               if (error)
+                       return error;
+               timespec50_to_timespec(&ats50, &ats);
+               ts = &ats;
+       }
+       if (sigset) {
+               error = copyin(sigset, &amask, sizeof(amask));
+               if (error)
+                       return error;
+               mask = &amask;
+       }
+
+       error = pollcommon(&retval, fds, nfds, ts, mask);
+
+       rump_unschedule();
+
+       if (error) {
+               rumpuser_seterrno(error);
+               retval = -1;
+       }
+
+       return retval;
+}
diff -r c8e630a2e676 -r 7c08a6030ddf sys/rump/librump/rumpvfs/compat.c
--- a/sys/rump/librump/rumpvfs/compat.c Mon Jul 19 15:30:43 2010 +0000
+++ b/sys/rump/librump/rumpvfs/compat.c Mon Jul 19 15:33:16 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat.c,v 1.5 2009/10/14 18:18:53 pooka Exp $ */
+/*     $NetBSD: compat.c,v 1.6 2010/07/19 15:33:16 pooka Exp $ */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat.c,v 1.5 2009/10/14 18:18:53 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat.c,v 1.6 2010/07/19 15:33:16 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -39,6 +39,7 @@
 #include <compat/sys/time.h>
 
 #include <rump/rump.h>
+#include <rump/rump_syscalls_compat.h>
 #include <rump/rumpuser.h>
 
 #include "rump_vfs_private.h"
@@ -80,7 +81,7 @@
 };
 
 int
-rump_sys___stat30(const char *path, struct stat *sb)
+rump_sys_nb5_stat(const char *path, struct stat *sb)
 {
        struct compat_50_sys___stat30_args args;
        register_t retval = 0;
@@ -89,16 +90,18 @@
        SPARG(&args, path) = path;
        SPARG(&args, ub) = (struct stat30 *)sb;
 
+       rump_schedule();
        error = compat_50_sys___stat30(curlwp, &args, &retval);
        if (error) {
                retval = -1;
                rumpuser_seterrno(error);
        }
+       rump_unschedule();
        return retval;
 }
 
 int
-rump_sys___lstat30(const char *path, struct stat *sb)
+rump_sys_nb5_lstat(const char *path, struct stat *sb)
 {
        struct compat_50_sys___lstat30_args args;
        register_t retval = 0;
@@ -107,11 +110,13 @@
        SPARG(&args, path) = path;
        SPARG(&args, ub) = (struct stat30 *)sb;
 
+       rump_schedule();
        error = compat_50_sys___lstat30(curlwp, &args, &retval);
        if (error) {
                retval = -1;
                rumpuser_seterrno(error);
        }
+       rump_unschedule();
        return retval;
 }
 



Home | Main Index | Thread Index | Old Index