Module Name: src Committed By: pooka Date: Mon Jul 19 15:33:16 UTC 2010
Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern src/sys/rump/librump/rumpvfs: compat.c Added Files: src/sys/rump/librump/rumpkern: compat.c Log Message: * move stat syscalls to newstyle compat * implement compat for pollts To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r0 -r1.1 src/sys/rump/librump/rumpkern/compat.c cvs rdiff -u -r1.5 -r1.6 src/sys/rump/librump/rumpvfs/compat.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/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.91 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.92 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.91 Wed Jun 16 11:45:21 2010 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Mon Jul 19 15:33:16 2010 @@ -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. Index: src/sys/rump/librump/rumpvfs/compat.c diff -u src/sys/rump/librump/rumpvfs/compat.c:1.5 src/sys/rump/librump/rumpvfs/compat.c:1.6 --- src/sys/rump/librump/rumpvfs/compat.c:1.5 Wed Oct 14 18:18:53 2009 +++ src/sys/rump/librump/rumpvfs/compat.c Mon Jul 19 15:33:16 2010 @@ -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; } Added files: Index: src/sys/rump/librump/rumpkern/compat.c diff -u /dev/null src/sys/rump/librump/rumpkern/compat.c:1.1 --- /dev/null Mon Jul 19 15:33:16 2010 +++ src/sys/rump/librump/rumpkern/compat.c Mon Jul 19 15:33:16 2010 @@ -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; +}