CVS commit: src/sys/rump/dev/lib/libugenhc
Module Name:src Committed By: pooka Date: Sun Apr 28 10:23:36 UTC 2013 Modified Files: src/sys/rump/dev/lib/libugenhc: rumpcomp_user.c Log Message: need errno To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/lib/libugenhc/rumpcomp_user.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/dev/lib/libugenhc/rumpcomp_user.c diff -u src/sys/rump/dev/lib/libugenhc/rumpcomp_user.c:1.1 src/sys/rump/dev/lib/libugenhc/rumpcomp_user.c:1.2 --- src/sys/rump/dev/lib/libugenhc/rumpcomp_user.c:1.1 Sun Apr 28 09:58:11 2013 +++ src/sys/rump/dev/lib/libugenhc/rumpcomp_user.c Sun Apr 28 10:23:36 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.c,v 1.1 2013/04/28 09:58:11 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.c,v 1.2 2013/04/28 10:23:36 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,6 +28,8 @@ #include sys/types.h #include sys/ioctl.h +#include errno.h + #include rump/rumpuser_component.h #include rumpcomp_user.h
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Sun Apr 28 10:25:05 UTC 2013 Modified Files: src/sys/rump: Makefile.rump Log Message: Build only rumpcomp_user.c as part of the rumpcomp_user rules (otherwise ioconf.c wants to be part of .ALLSRC for whatever reason I'm not really interested in, but which the make gurus will surely explain to me) To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/sys/rump/Makefile.rump 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/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.79 src/sys/rump/Makefile.rump:1.80 --- src/sys/rump/Makefile.rump:1.79 Sat Apr 27 12:51:45 2013 +++ src/sys/rump/Makefile.rump Sun Apr 28 10:25:04 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.79 2013/04/27 12:51:45 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.80 2013/04/28 10:25:04 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -94,19 +94,19 @@ DESTDIR=/ BUILDRUMP_CPPFLAGS ?= -isysroot ${DESTDIR} rumpcomp_user.d: rumpcomp_user.c ${_MKTARGET_CREATE} - ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.ALLSRC:O:u:M*.c} + ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.ALLSRC:O:u:M*rumpcomp_user.c} rumpcomp_user.o: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*.c} + ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*rumpcomp_user.c} rumpcomp_user.pico: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*.c} + ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*rumpcomp_user.c} rumpcomp_user.po: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*.c} + ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*rumpcomp_user.c} RUMPCOMP_USEROBJ=rumpcomp_user.*o SRCS+=rumpcomp_user.c
CVS commit: src/sys/rump/dev/lib/libugenhc
Module Name:src Committed By: pooka Date: Sun Apr 28 10:25:41 UTC 2013 Modified Files: src/sys/rump/dev/lib/libugenhc: Makefile Log Message: problem with ioconf.c solved, reenable To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/rump/dev/lib/libugenhc/Makefile 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/dev/lib/libugenhc/Makefile diff -u src/sys/rump/dev/lib/libugenhc/Makefile:1.5 src/sys/rump/dev/lib/libugenhc/Makefile:1.6 --- src/sys/rump/dev/lib/libugenhc/Makefile:1.5 Sun Apr 28 10:16:52 2013 +++ src/sys/rump/dev/lib/libugenhc/Makefile Sun Apr 28 10:25:41 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2013/04/28 10:16:52 pooka Exp $ +# $NetBSD: Makefile,v 1.6 2013/04/28 10:25:41 pooka Exp $ # LIB= rumpdev_ugenhc @@ -8,7 +8,7 @@ SRCS= ugenhc.c ugenhc_at_mainbus.c CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -#RUMPCOMP_USER= #ioctl +RUMPCOMP_USER= #ioctl .include bsd.lib.mk .include bsd.klinks.mk
CVS commit: src
Module Name:src Committed By: pooka Date: Sun Apr 28 10:43:46 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/net/lib/libshmif: Makefile if_shmem.c Added Files: src/sys/rump/net/lib/libshmif: rumpcomp_user.c rumpcomp_user.h Log Message: make the file monitoring hypercalls private to shmif To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/lib/librumpuser/rumpuser.c cvs rdiff -u -r1.86 -r1.87 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libshmif/Makefile cvs rdiff -u -r1.47 -r1.48 src/sys/rump/net/lib/libshmif/if_shmem.c cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libshmif/rumpcomp_user.c \ src/sys/rump/net/lib/libshmif/rumpcomp_user.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.34 src/lib/librumpuser/rumpuser.c:1.35 --- src/lib/librumpuser/rumpuser.c:1.34 Sun Apr 28 09:58:11 2013 +++ src/lib/librumpuser/rumpuser.c Sun Apr 28 10:43:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.34 2013/04/28 09:58:11 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.35 2013/04/28 10:43:45 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser.c,v 1.34 2013/04/28 09:58:11 pooka Exp $); +__RCSID($NetBSD: rumpuser.c,v 1.35 2013/04/28 10:43:45 pooka Exp $); #endif /* !lint */ #include sys/ioctl.h @@ -601,139 +601,6 @@ rumpuser_seterrno(int error) } /* - * On NetBSD we use kqueue, on Linux we use inotify. The underlying - * interface requirements aren't quite the same, but we have a very - * good chance of doing the fd-path mapping on Linux thanks to dcache, - * so just keep the existing interfaces for now. - */ -#if defined(__NetBSD__) -int -rumpuser_writewatchfile_setup(int kq, int fd, intptr_t opaque, int *error) -{ - struct kevent kev; - - if (kq == -1) { - kq = kqueue(); - if (kq == -1) { - seterror(errno); - return -1; - } - } - - EV_SET(kev, fd, EVFILT_VNODE, EV_ADD|EV_ENABLE|EV_CLEAR, - NOTE_WRITE, 0, opaque); - if (kevent(kq, kev, 1, NULL, 0, NULL) == -1) { - seterror(errno); - return -1; - } - - return kq; -} - -int -rumpuser_writewatchfile_wait(int kq, intptr_t *opaque, int *error) -{ - struct kevent kev; - int rv; - - again: - KLOCK_WRAP(rv = kevent(kq, NULL, 0, kev, 1, NULL)); - if (rv == -1) { - if (errno == EINTR) - goto again; - seterror(errno); - return -1; - } - - if (opaque) - *opaque = kev.udata; - return rv; -} - -#elif defined(__linux__) -#include sys/inotify.h - -int -rumpuser_writewatchfile_setup(int inotify, int fd, intptr_t notused, int *error) -{ - char procbuf[PATH_MAX], linkbuf[PATH_MAX]; - ssize_t nn; - - if (inotify == -1) { - inotify = inotify_init(); - if (inotify == -1) { - seterror(errno); - return -1; - } - } - - /* ok, need to map fd into path for inotify */ - snprintf(procbuf, sizeof(procbuf), /proc/self/fd/%d, fd); - nn = readlink(procbuf, linkbuf, sizeof(linkbuf)-1); - if (nn = (ssize_t)sizeof(linkbuf)-1) { - nn = -1; - errno = E2BIG; /* pick something */ - } - if (nn == -1) { - seterror(errno); - close(inotify); - return -1; - } - - linkbuf[nn] = '\0'; - if (inotify_add_watch(inotify, linkbuf, IN_MODIFY) == -1) { - seterror(errno); - close(inotify); - return -1; - } - - return inotify; -} - -int -rumpuser_writewatchfile_wait(int kq, intptr_t *opaque, int *error) -{ - struct inotify_event iev; - ssize_t nn; - - do { - KLOCK_WRAP(nn = read(kq, iev, sizeof(iev))); - } while (errno == EINTR); - - if (nn == -1) { - seterror(errno); - return -1; - } - return (nn/sizeof(iev)); -} - -#else - -/* a polling default implementation */ -int -rumpuser_writewatchfile_setup(int inotify, int fd, intptr_t notused, int *error) -{ - static int warned = 0; - - if (!warned) { - fprintf(stderr, WARNING: rumpuser writewatchfile routines are - polling-only on this platform\n); - warned = 1; - } - - return 0; -} - -int -rumpuser_writewatchfile_wait(int kq, intptr_t *opaque, int *error) -{ - - KLOCK_WRAP(usleep(1)); - return 0; -} -#endif - -/* * This is meant for safe debugging prints from the kernel. */ int Index: src/sys/rump/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.86 src/sys/rump/include/rump/rumpuser.h:1.87 --- src/sys/rump/include/rump/rumpuser.h:1.86 Sun Apr 28 09:58:11 2013 +++ src/sys/rump/include/rump/rumpuser.h Sun Apr 28 10:43:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.86 2013/04/28 09:58:11 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.87 2013/04/28 10:43:45 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -113,9 +113,6 @@ int rumpuser_kill(int64_t, int, int *); void rumpuser_exit(int) __dead; void rumpuser_seterrno
CVS commit: src/sys/rump/net/lib/libshmif
Module Name:src Committed By: pooka Date: Sun Apr 28 10:53:22 UTC 2013 Modified Files: src/sys/rump/net/lib/libshmif: if_shmem.c rumpcomp_user.c rumpcomp_user.h Log Message: * remove the unused opaque parameter * fix some typos in the previous To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/rump/net/lib/libshmif/if_shmem.c cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libshmif/rumpcomp_user.c \ src/sys/rump/net/lib/libshmif/rumpcomp_user.h 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/net/lib/libshmif/if_shmem.c diff -u src/sys/rump/net/lib/libshmif/if_shmem.c:1.48 src/sys/rump/net/lib/libshmif/if_shmem.c:1.49 --- src/sys/rump/net/lib/libshmif/if_shmem.c:1.48 Sun Apr 28 10:43:45 2013 +++ src/sys/rump/net/lib/libshmif/if_shmem.c Sun Apr 28 10:53:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_shmem.c,v 1.48 2013/04/28 10:43:45 pooka Exp $ */ +/* $NetBSD: if_shmem.c,v 1.49 2013/04/28 10:53:21 pooka Exp $ */ /* * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_shmem.c,v 1.48 2013/04/28 10:43:45 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: if_shmem.c,v 1.49 2013/04/28 10:53:21 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -251,7 +251,7 @@ initbackend(struct shmif_sc *sc, int mem #endif shmif_unlockbus(sc-sc_busmem); - sc-sc_kq = rumpcomp_shmif_watchsetup(-1, memfd, 0, error); + sc-sc_kq = rumpcomp_shmif_watchsetup(-1, memfd, error); if (sc-sc_kq == -1) { rumpuser_unmap(sc-sc_busmem, BUSMEM_SIZE); return error; @@ -669,7 +669,7 @@ shmif_rcv(void *arg) == sc-sc_nextpacket) { shmif_unlockbus(busmem); error = 0; - rumpcomp_shmif_watchwait(sc-sc_kq, NULL, error); + rumpcomp_shmif_watchwait(sc-sc_kq, error); if (__predict_false(error)) printf(shmif_rcv: wait failed %d\n, error); membar_consumer(); Index: src/sys/rump/net/lib/libshmif/rumpcomp_user.c diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.1 src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.2 --- src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.1 Sun Apr 28 10:43:45 2013 +++ src/sys/rump/net/lib/libshmif/rumpcomp_user.c Sun Apr 28 10:53:22 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.c,v 1.1 2013/04/28 10:43:45 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.c,v 1.2 2013/04/28 10:53:22 pooka Exp $ */ /*- * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. @@ -42,7 +42,7 @@ */ #if defined(__NetBSD__) int -rumpcomp_shmif_watchsetup(int kq, int fd, intptr_t opaque, int *error) +rumpcomp_shmif_watchsetup(int kq, int fd, int *error) { struct kevent kev; int rv; @@ -56,14 +56,16 @@ rumpcomp_shmif_watchsetup(int kq, int fd } EV_SET(kev, fd, EVFILT_VNODE, EV_ADD|EV_ENABLE|EV_CLEAR, - NOTE_WRITE, 0, opaque); + NOTE_WRITE, 0, 0); rv = kevent(kq, kev, 1, NULL, 0, NULL); *error = errno; - return rv; + if (rv == -1) + return -1; + return kq; } int -rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error) +rumpcomp_shmif_watchwait(int kq, int *error) { void *cookie; struct kevent kev; @@ -73,10 +75,8 @@ rumpcomp_shmif_watchwait(int kq, intptr_ do { rv = kevent(kq, NULL, 0, kev, 1, NULL); } while (rv == -1 errno == EINTR); - *error = errno; - if (rv != -1 opaque) - *opaque = kev.udata; + rumpuser_component_schedule(cookie); return rv; } @@ -85,7 +85,7 @@ rumpcomp_shmif_watchwait(int kq, intptr_ #include sys/inotify.h int -rumpcomp_shmif_watchsetup(int inotify, int fd, intptr_t notused, int *error) +rumpcomp_shmif_watchsetup(int inotify, int fd, int *error) { char procbuf[PATH_MAX], linkbuf[PATH_MAX]; ssize_t nn; @@ -122,7 +122,7 @@ rumpcomp_shmif_watchsetup(int inotify, i } int -rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error) +rumpcomp_shmif_watchwait(int kq, int *error) { struct inotify_event iev; void *cookie; @@ -145,7 +145,7 @@ rumpcomp_shmif_watchwait(int kq, intptr_ /* a polling default implementation */ int -rumpcomp_shmif_watchsetup(int inotify, int fd, intptr_t notused, int *error) +rumpcomp_shmif_watchsetup(int inotify, int fd, int *error) { static int warned = 0; @@ -159,7 +159,7 @@ rumpcomp_shmif_watchsetup(int inotify, i } int -rumpcomp_shmif_watchwait(int kq, intptr_t *opaque, int *error) +rumpcomp_shmif_watchwait(int kq, int *error) { void *cookie; Index: src/sys/rump/net/lib/libshmif/rumpcomp_user.h diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.h:1.1 src/sys/rump/net/lib/libshmif/rumpcomp_user.h:1.2 --- src/sys/rump/net/lib/libshmif/rumpcomp_user.h:1.1 Sun Apr 28 10:43:45 2013 +++ src/sys/rump/net/lib/libshmif/rumpcomp_user.h Sun Apr 28 10:53:22 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.h,v 1.1 2013/04/28 10:43:45 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.h,v 1.2 2013/04/28 10:53:22 pooka Exp
CVS commit: src/sys/rump/net/lib/libshmif
Module Name:src Committed By: pooka Date: Sun Apr 28 11:03:25 UTC 2013 Modified Files: src/sys/rump/net/lib/libshmif: rumpcomp_user.c Log Message: be a bit less sloppy with errno To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libshmif/rumpcomp_user.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/net/lib/libshmif/rumpcomp_user.c diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.2 src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.3 --- src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.2 Sun Apr 28 10:53:22 2013 +++ src/sys/rump/net/lib/libshmif/rumpcomp_user.c Sun Apr 28 11:03:25 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.c,v 1.2 2013/04/28 10:53:22 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.c,v 1.3 2013/04/28 11:03:25 pooka Exp $ */ /*- * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. @@ -34,6 +34,8 @@ #include rumpcomp_user.h +#define seterr(_v_) if ((_v_) == -1) *error = errno; else *error = 0; + /* * On NetBSD we use kqueue, on Linux we use inotify. The underlying * interface requirements aren't quite the same, but we have a very @@ -58,7 +60,7 @@ rumpcomp_shmif_watchsetup(int kq, int fd EV_SET(kev, fd, EVFILT_VNODE, EV_ADD|EV_ENABLE|EV_CLEAR, NOTE_WRITE, 0, 0); rv = kevent(kq, kev, 1, NULL, 0, NULL); - *error = errno; + seterr(rv); if (rv == -1) return -1; return kq; @@ -75,9 +77,9 @@ rumpcomp_shmif_watchwait(int kq, int *er do { rv = kevent(kq, NULL, 0, kev, 1, NULL); } while (rv == -1 errno == EINTR); - *error = errno; - + seterr(rv); rumpuser_component_schedule(cookie); + return rv; } @@ -117,6 +119,7 @@ rumpcomp_shmif_watchsetup(int inotify, i close(inotify); return -1; } + *error = 0; return inotify; } @@ -132,7 +135,7 @@ rumpcomp_shmif_watchwait(int kq, int *er do { nn = read(kq, iev, sizeof(iev)); } while (errno == EINTR); - *error = errno; + seterr(nn); rumpuser_component_schedule(cookie); if (nn == -1) {
CVS commit: src
Module Name:src Committed By: pooka Date: Sun Apr 28 12:54:40 UTC 2013 Modified Files: src: build.sh src/sys/rump: Makefile.rump Log Message: fix build.sh rumptest wrt private hypercalls To generate a diff of this commit: cvs rdiff -u -r1.265 -r1.266 src/build.sh cvs rdiff -u -r1.80 -r1.81 src/sys/rump/Makefile.rump Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/build.sh diff -u src/build.sh:1.265 src/build.sh:1.266 --- src/build.sh:1.265 Thu Mar 7 04:51:58 2013 +++ src/build.sh Sun Apr 28 12:54:39 2013 @@ -1,5 +1,5 @@ #! /usr/bin/env sh -# $NetBSD: build.sh,v 1.265 2013/03/07 04:51:58 oki Exp $ +# $NetBSD: build.sh,v 1.266 2013/04/28 12:54:39 pooka Exp $ # # Copyright (c) 2001-2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -1730,7 +1730,7 @@ createmakewrapper() eval cat EOF ${makewrapout} #! ${HOST_SH} # Set proper variables to allow easy make building of a NetBSD subtree. -# Generated from: \$NetBSD: build.sh,v 1.265 2013/03/07 04:51:58 oki Exp $ +# Generated from: \$NetBSD: build.sh,v 1.266 2013/04/28 12:54:39 pooka Exp $ # with these arguments: ${_args} # @@ -1958,6 +1958,7 @@ dorump() [ ${1} != rumptest ] bomb 'build.sh rump not yet functional. ' \ 'did you mean rumptest?' + export RUMPTEST_BUILDSH=1 # create obj and distrib dirs if [ ${MKOBJDIRS} != no ]; then make_in_dir ${NETBSDSRCDIR}/etc/mtree obj @@ -1998,7 +1999,7 @@ dorump() /undefined reference/ !/more undefined references.*follow/{ if (match($NF, -`(rumpuser_|__ quirks )) == 0) +`(rumpuser_|rumpcomp_|__ quirks )) == 0) fails[NR] = $0 } /cannot find -l/{fails[NR] = $0} Index: src/sys/rump/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.80 src/sys/rump/Makefile.rump:1.81 --- src/sys/rump/Makefile.rump:1.80 Sun Apr 28 10:25:04 2013 +++ src/sys/rump/Makefile.rump Sun Apr 28 12:54:39 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.80 2013/04/28 10:25:04 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.81 2013/04/28 12:54:39 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -87,7 +87,7 @@ DPSRCS+= ${RUMPTOP}/Makefile.rump # -.ifdef RUMPCOMP_USER +.ifdef RUMPCOMP_USER !defined(RUMPTEST_BUILDSH) .if empty(DESTDIR) DESTDIR=/ .endif
CVS commit: src
Module Name:src Committed By: pooka Date: Sun Apr 28 13:17:26 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser.c rumpuser_port.h src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: emul.c intr.c rump.c vm.c src/sys/rump/net/lib/libshmif: if_shmem.c Log Message: Improve the time-related hypercalls so that's it's possible to sleep until an absolute time on the host's monotonic clock (should something like that be supported). To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/lib/librumpuser/rumpuser.c cvs rdiff -u -r1.17 -r1.18 src/lib/librumpuser/rumpuser_port.h cvs rdiff -u -r1.87 -r1.88 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.155 -r1.156 src/sys/rump/librump/rumpkern/emul.c cvs rdiff -u -r1.37 -r1.38 src/sys/rump/librump/rumpkern/intr.c cvs rdiff -u -r1.261 -r1.262 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.138 -r1.139 src/sys/rump/librump/rumpkern/vm.c cvs rdiff -u -r1.49 -r1.50 src/sys/rump/net/lib/libshmif/if_shmem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.35 src/lib/librumpuser/rumpuser.c:1.36 --- src/lib/librumpuser/rumpuser.c:1.35 Sun Apr 28 10:43:45 2013 +++ src/lib/librumpuser/rumpuser.c Sun Apr 28 13:17:25 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.35 2013/04/28 10:43:45 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.36 2013/04/28 13:17:25 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser.c,v 1.35 2013/04/28 10:43:45 pooka Exp $); +__RCSID($NetBSD: rumpuser.c,v 1.36 2013/04/28 13:17:25 pooka Exp $); #endif /* !lint */ #include sys/ioctl.h @@ -218,27 +218,6 @@ rumpuser_getfileinfo(const char *path, u return rv; } -int -rumpuser_nanosleep(uint64_t *sec, uint64_t *nsec, int *error) -{ - struct timespec rqt, rmt; - int rv; - - /*LINTED*/ - rqt.tv_sec = *sec; - /*LINTED*/ - rqt.tv_nsec = *nsec; - - KLOCK_WRAP(rv = nanosleep(rqt, rmt)); - if (rv == -1) - seterror(errno); - - *sec = rmt.tv_sec; - *nsec = rmt.tv_nsec; - - return rv; -} - void * rumpuser_malloc(size_t howmuch, int alignment) { @@ -536,24 +515,97 @@ rumpuser_writev(int fd, const struct rum } int -rumpuser_gettime(uint64_t *sec, uint64_t *nsec, int *error) +rumpuser_clock_gettime(uint64_t *sec, uint64_t *nsec, enum rumpclock rclk) { - struct timeval tv; + struct timespec ts; + clockid_t clk; int rv; - rv = gettimeofday(tv, NULL); - if (rv == -1) { - seterror(errno); - return rv; + switch (rclk) { + case RUMPUSER_CLOCK_RELWALL: + clk = CLOCK_REALTIME; + break; + case RUMPUSER_CLOCK_ABSMONO: +#ifdef HAVE_CLOCK_NANOSLEEP + clk = CLOCK_MONOTONIC; +#else + clk = CLOCK_REALTIME; +#endif + break; + default: + abort(); } - *sec = tv.tv_sec; - *nsec = tv.tv_usec * 1000; + rv = clock_gettime(clk, ts); + if (rv == -1) { + return errno; + } + *sec = ts.tv_sec; + *nsec = ts.tv_nsec; return 0; } int +rumpuser_clock_sleep(uint64_t sec, uint64_t nsec, enum rumpclock clk) +{ + struct timespec rqt, rmt; + int nlocks; + int rv; + + rumpuser__unschedule(0, nlocks, NULL); + + /*LINTED*/ + rqt.tv_sec = sec; + /*LINTED*/ + rqt.tv_nsec = nsec; + + switch (clk) { + case RUMPUSER_CLOCK_RELWALL: + do { + rv = nanosleep(rqt, rmt); + rqt = rmt; + } while (rv == -1 errno == EINTR); + if (rv == -1) { + rv = errno; + } + break; + case RUMPUSER_CLOCK_ABSMONO: + do { +#ifdef HAVE_CLOCK_NANOSLEEP + rv = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, + rqt, NULL); +#else + /* le/la/der/die/das sigh. timevalspec tailspin */ + struct timespec ts, tsr; + clock_gettime(CLOCK_REALTIME, ts); + if (ts.tv_sec == rqt.tv_sec ? + ts.tv_nsec rqt.tv_nsec : ts.tv_sec rqt.tv_sec) { +rv = 0; + } else { +tsr.tv_sec = rqt.tv_sec - ts.tv_sec; +tsr.tv_nsec = rqt.tv_nsec - ts.tv_nsec; +if (tsr.tv_nsec 0) { + tsr.tv_sec--; + tsr.tv_nsec += 1000*1000*1000; +} +rv = nanosleep(tsr, NULL); + } +#endif + } while (rv == -1 errno == EINTR); + if (rv == -1) { + rv = errno; + } + break; + default: + abort(); + } + + rumpuser__reschedule(nlocks, NULL); + return rv; +} + +int rumpuser_getenv(const char *name, char *buf, size_t blen, int *error) { Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.17 src/lib/librumpuser/rumpuser_port.h:1.18 --- src/lib/librumpuser/rumpuser_port.h:1.17 Sat Apr 27 16:56:29 2013 +++ src/lib/librumpuser/rumpuser_port.h Sun Apr 28 13:17:26 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_port.h,v 1.17 2013/04/27 16:56:29 pooka Exp $ */ +/* $NetBSD: rumpuser_port.h,v 1.18 2013/04/28 13:17:26 pooka Exp $ */ /* * Portability header for non-NetBSD platforms. @@ -31,11 +31,20 @@ #define PLATFORM_HAS_NBQUOTA
CVS commit: src
Module Name:src Committed By: pooka Date: Sun Apr 28 13:37:52 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_pth.c src/sys/rump/librump/rumpkern: locks.c locks_up.c ltsleep.c Log Message: Change rumpuser_cv_timedwait() from absolute time to relative time. It's then the hypervisor's problem to translate it accordingly. Now we no longer have to worry about the kernel having to know the hypervisor's time and vice versa. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/librumpuser/rumpuser_pth.c cvs rdiff -u -r1.57 -r1.58 src/sys/rump/librump/rumpkern/locks.c cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpkern/locks_up.c cvs rdiff -u -r1.30 -r1.31 src/sys/rump/librump/rumpkern/ltsleep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_pth.c diff -u src/lib/librumpuser/rumpuser_pth.c:1.15 src/lib/librumpuser/rumpuser_pth.c:1.16 --- src/lib/librumpuser/rumpuser_pth.c:1.15 Sat Apr 27 16:32:58 2013 +++ src/lib/librumpuser/rumpuser_pth.c Sun Apr 28 13:37:51 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_pth.c,v 1.15 2013/04/27 16:32:58 pooka Exp $ */ +/* $NetBSD: rumpuser_pth.c,v 1.16 2013/04/28 13:37:51 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_pth.c,v 1.15 2013/04/27 16:32:58 pooka Exp $); +__RCSID($NetBSD: rumpuser_pth.c,v 1.16 2013/04/28 13:37:51 pooka Exp $); #endif /* !lint */ #include assert.h @@ -489,12 +489,25 @@ rumpuser_cv_timedwait(struct rumpuser_cv struct timespec ts; int rv, nlocks; - /* LINTED */ - ts.tv_sec = sec; ts.tv_nsec = nsec; + /* + * Get clock already here, just in case we will be put to sleep + * after releasing the kernel context. + * + * The condition variables should use CLOCK_MONOTONIC, but since + * that's not available everywhere, leave it for another day. + */ + clock_gettime(CLOCK_REALTIME, ts); cv-nwaiters++; rumpuser__unschedule(0, nlocks, mtx); mtxexit(mtx); + + ts.tv_sec += sec; + ts.tv_nsec += nsec; + if (ts.tv_nsec = 1000*1000*1000) { + ts.tv_sec++; + ts.tv_nsec -= 1000*1000*1000; + } rv = pthread_cond_timedwait(cv-pthcv, mtx-pthmtx, ts); mtxenter(mtx); rumpuser__reschedule(nlocks, mtx); Index: src/sys/rump/librump/rumpkern/locks.c diff -u src/sys/rump/librump/rumpkern/locks.c:1.57 src/sys/rump/librump/rumpkern/locks.c:1.58 --- src/sys/rump/librump/rumpkern/locks.c:1.57 Sat Apr 27 16:32:57 2013 +++ src/sys/rump/librump/rumpkern/locks.c Sun Apr 28 13:37:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: locks.c,v 1.57 2013/04/27 16:32:57 pooka Exp $ */ +/* $NetBSD: locks.c,v 1.58 2013/04/28 13:37:52 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: locks.c,v 1.57 2013/04/27 16:32:57 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: locks.c,v 1.58 2013/04/28 13:37:52 pooka Exp $); #include sys/param.h #include sys/kmem.h @@ -382,22 +382,15 @@ cv_wait_sig(kcondvar_t *cv, kmutex_t *mt int cv_timedwait(kcondvar_t *cv, kmutex_t *mtx, int ticks) { - struct timespec ts, tick; + struct timespec ts; extern int hz; int rv; if (ticks == 0) { rv = cv_wait_sig(cv, mtx); } else { - /* - * XXX: this fetches rump kernel time, but - * rumpuser_cv_timedwait uses host time. - */ - nanotime(ts); - tick.tv_sec = ticks / hz; - tick.tv_nsec = (ticks % hz) * (10/hz); - timespecadd(ts, tick, ts); - + ts.tv_sec = ticks / hz; + ts.tv_nsec = (ticks % hz) * (10/hz); rv = docvwait(cv, mtx, ts); } Index: src/sys/rump/librump/rumpkern/locks_up.c diff -u src/sys/rump/librump/rumpkern/locks_up.c:1.7 src/sys/rump/librump/rumpkern/locks_up.c:1.8 --- src/sys/rump/librump/rumpkern/locks_up.c:1.7 Sat Apr 27 13:59:46 2013 +++ src/sys/rump/librump/rumpkern/locks_up.c Sun Apr 28 13:37:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: locks_up.c,v 1.7 2013/04/27 13:59:46 pooka Exp $ */ +/* $NetBSD: locks_up.c,v 1.8 2013/04/28 13:37:52 pooka Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: locks_up.c,v 1.7 2013/04/27 13:59:46 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: locks_up.c,v 1.8 2013/04/28 13:37:52 pooka Exp $); #include sys/param.h #include sys/kernel.h @@ -375,21 +375,15 @@ cv_wait_sig(kcondvar_t *cv, kmutex_t *mt int cv_timedwait(kcondvar_t *cv, kmutex_t *mtx, int ticks) { - struct timespec ts, tstick; + struct timespec ts; #ifdef DIAGNOSTIC UPMTX(mtx); KASSERT(upm-upm_owner == curlwp); #endif - /* - * XXX: this fetches rump kernel time, but rumpuser_cv_timedwait - * uses host time. - */ - nanotime(ts); - tstick.tv_sec = ticks / hz; - tstick.tv_nsec = (ticks % hz) * (10/hz); - timespecadd(ts, tstick, ts
CVS commit: src/sys/rump/net/lib/libshmif
Module Name:src Committed By: pooka Date: Sun Apr 28 13:38:35 UTC 2013 Modified Files: src/sys/rump/net/lib/libshmif: rumpcomp_user.c Log Message: include event.h only where used To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libshmif/rumpcomp_user.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/net/lib/libshmif/rumpcomp_user.c diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.3 src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.4 --- src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.3 Sun Apr 28 11:03:25 2013 +++ src/sys/rump/net/lib/libshmif/rumpcomp_user.c Sun Apr 28 13:38:35 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.c,v 1.3 2013/04/28 11:03:25 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.c,v 1.4 2013/04/28 13:38:35 pooka Exp $ */ /*- * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. @@ -26,7 +26,6 @@ */ #include sys/types.h -#include sys/event.h #include errno.h @@ -43,6 +42,8 @@ * so just keep the existing interfaces for now. */ #if defined(__NetBSD__) +#include sys/event.h + int rumpcomp_shmif_watchsetup(int kq, int fd, int *error) {
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Sun Apr 28 13:39:13 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser.c Log Message: don't need event.h here anymore To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/lib/librumpuser/rumpuser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.36 src/lib/librumpuser/rumpuser.c:1.37 --- src/lib/librumpuser/rumpuser.c:1.36 Sun Apr 28 13:17:25 2013 +++ src/lib/librumpuser/rumpuser.c Sun Apr 28 13:39:13 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.36 2013/04/28 13:17:25 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.37 2013/04/28 13:39:13 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser.c,v 1.36 2013/04/28 13:17:25 pooka Exp $); +__RCSID($NetBSD: rumpuser.c,v 1.37 2013/04/28 13:39:13 pooka Exp $); #endif /* !lint */ #include sys/ioctl.h @@ -41,7 +41,6 @@ __RCSID($NetBSD: rumpuser.c,v 1.36 2013 #include sys/disk.h #include sys/disklabel.h #include sys/dkio.h -#include sys/event.h #endif #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
CVS commit: src/sys/rump/net/lib/libshmif
Module Name:src Committed By: pooka Date: Sun Apr 28 14:11:44 UTC 2013 Modified Files: src/sys/rump/net/lib/libshmif: rumpcomp_user.c Log Message: some more headers are required by the third implementation To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libshmif/rumpcomp_user.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/net/lib/libshmif/rumpcomp_user.c diff -u src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.4 src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.5 --- src/sys/rump/net/lib/libshmif/rumpcomp_user.c:1.4 Sun Apr 28 13:38:35 2013 +++ src/sys/rump/net/lib/libshmif/rumpcomp_user.c Sun Apr 28 14:11:43 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.c,v 1.4 2013/04/28 13:38:35 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.c,v 1.5 2013/04/28 14:11:43 pooka Exp $ */ /*- * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. @@ -146,6 +146,8 @@ rumpcomp_shmif_watchwait(int kq, int *er } #else +#include stdio.h +#include unistd.h /* a polling default implementation */ int
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Apr 28 23:19:34 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: lwproc.c Log Message: One more mutex which is used as a spin mutex and therefore needs to be tagged as one, lest the mighty assert smites thee. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/rump/librump/rumpkern/lwproc.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/lwproc.c diff -u src/sys/rump/librump/rumpkern/lwproc.c:1.20 src/sys/rump/librump/rumpkern/lwproc.c:1.21 --- src/sys/rump/librump/rumpkern/lwproc.c:1.20 Thu Mar 7 18:49:13 2013 +++ src/sys/rump/librump/rumpkern/lwproc.c Sun Apr 28 23:19:33 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: lwproc.c,v 1.20 2013/03/07 18:49:13 pooka Exp $ */ +/* $NetBSD: lwproc.c,v 1.21 2013/04/28 23:19:33 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: lwproc.c,v 1.20 2013/03/07 18:49:13 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: lwproc.c,v 1.21 2013/04/28 23:19:33 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -149,7 +149,7 @@ lwproc_newproc(struct proc *parent, int LIST_INIT(p-p_children); p-p_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE); - mutex_init(p-p_stmutex, MUTEX_DEFAULT, IPL_NONE); + mutex_init(p-p_stmutex, MUTEX_DEFAULT, IPL_HIGH); mutex_init(p-p_auxlock, MUTEX_DEFAULT, IPL_NONE); rw_init(p-p_reflock); cv_init(p-p_waitcv, pwait);
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Apr 28 23:21:00 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: vm.c Log Message: Appearances count: spell IPL_NONE correctly. To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/rump/librump/rumpkern/vm.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/vm.c diff -u src/sys/rump/librump/rumpkern/vm.c:1.139 src/sys/rump/librump/rumpkern/vm.c:1.140 --- src/sys/rump/librump/rumpkern/vm.c:1.139 Sun Apr 28 13:17:25 2013 +++ src/sys/rump/librump/rumpkern/vm.c Sun Apr 28 23:21:00 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vm.c,v 1.139 2013/04/28 13:17:25 pooka Exp $ */ +/* $NetBSD: vm.c,v 1.140 2013/04/28 23:21:00 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -41,7 +41,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.139 2013/04/28 13:17:25 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.140 2013/04/28 23:21:00 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -335,11 +335,11 @@ uvm_init(void) #undef FAKE_PAGE_SHIFT #endif - mutex_init(pagermtx, MUTEX_DEFAULT, 0); - mutex_init(uvm_pageqlock, MUTEX_DEFAULT, 0); - mutex_init(uvm_swap_data_lock, MUTEX_DEFAULT, 0); + mutex_init(pagermtx, MUTEX_DEFAULT, IPL_NONE); + mutex_init(uvm_pageqlock, MUTEX_DEFAULT, IPL_NONE); + mutex_init(uvm_swap_data_lock, MUTEX_DEFAULT, IPL_NONE); - mutex_init(pdaemonmtx, MUTEX_DEFAULT, 0); + mutex_init(pdaemonmtx, MUTEX_DEFAULT, IPL_NONE); cv_init(pdaemoncv, pdaemon); cv_init(oomwait, oomwait);
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Sat Apr 27 12:51:45 UTC 2013 Modified Files: src/sys/rump: Makefile.rump Log Message: Allow to completely skip the ldscript, useful for linkers that don't need one. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/rump/Makefile.rump 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/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.78 src/sys/rump/Makefile.rump:1.79 --- src/sys/rump/Makefile.rump:1.78 Sun Mar 17 01:13:00 2013 +++ src/sys/rump/Makefile.rump Sat Apr 27 12:51:45 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.78 2013/03/17 01:13:00 christos Exp $ +# $NetBSD: Makefile.rump,v 1.79 2013/04/27 12:51:45 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -37,6 +37,8 @@ CPPFLAGS+= -I${RUMPTOP}/../arch CPPFLAGS+= -I${RUMPTOP}/.. .endif +RUMP_LDSCRIPT?=yes +.if ${RUMP_LDSCRIPT} != no # my ld or yours? .ifdef HAVE_SUN_LD LDFLAGS+= -Wl,-M ${RUMPTOP}/ldscript_sun.rump @@ -45,6 +47,7 @@ SRCS+= linksyms_sun.c .else LDFLAGS+= -Wl,-T ${RUMPTOP}/ldscript.rump .endif +.endif RUMP_DIAGNOSTIC?=yes .if ${RUMP_DIAGNOSTIC} == yes
CVS commit: src
Module Name:src Committed By: pooka Date: Sat Apr 27 13:59:46 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_pth.c rumpuser_pth_dummy.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: locks.c locks_up.c Log Message: Try to make sure that the appropriate calls to mutex_enter() takes a spin mutex (i.e. does not relinquish cpu context while trying to take the mutex). Bump the hypercall interface version number. I'll be doing a bunch of other cleanups to simplify the interface for the benefit of alternative hypervisor implementations. I'll be riding this bump and doing a second one only after I'm finished with all of the changes. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/librumpuser/rumpuser_pth.c cvs rdiff -u -r1.7 -r1.8 src/lib/librumpuser/rumpuser_pth_dummy.c cvs rdiff -u -r1.75 -r1.76 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.55 -r1.56 src/sys/rump/librump/rumpkern/locks.c cvs rdiff -u -r1.6 -r1.7 src/sys/rump/librump/rumpkern/locks_up.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_pth.c diff -u src/lib/librumpuser/rumpuser_pth.c:1.12 src/lib/librumpuser/rumpuser_pth.c:1.13 --- src/lib/librumpuser/rumpuser_pth.c:1.12 Mon Feb 11 16:02:31 2013 +++ src/lib/librumpuser/rumpuser_pth.c Sat Apr 27 13:59:46 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_pth.c,v 1.12 2013/02/11 16:02:31 pooka Exp $ */ +/* $NetBSD: rumpuser_pth.c,v 1.13 2013/04/27 13:59:46 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_pth.c,v 1.12 2013/02/11 16:02:31 pooka Exp $); +__RCSID($NetBSD: rumpuser_pth.c,v 1.13 2013/04/27 13:59:46 pooka Exp $); #endif /* !lint */ #include assert.h @@ -58,10 +58,12 @@ do { \ }\ } while (/*CONSTCOND*/0) +#define MTX_KMUTEX 0x1 +#define MTX_ISSPIN 0x2 struct rumpuser_mtx { pthread_mutex_t pthmtx; struct lwp *owner; - int iskmutex; + int flags; }; #define RURW_AMWRITER(rw) (rw-writer == rumpuser_get_curlwp() \ @@ -295,22 +297,22 @@ rumpuser_mutex_init(struct rumpuser_mtx pthread_mutexattr_destroy(att); (*mtx)-owner = NULL; - (*mtx)-iskmutex = 0; + (*mtx)-flags = MTX_ISSPIN; } void -rumpuser_mutex_init_kmutex(struct rumpuser_mtx **mtx) +rumpuser_mutex_init_kmutex(struct rumpuser_mtx **mtx, int isspin) { rumpuser_mutex_init(mtx); - (*mtx)-iskmutex = 1; + (*mtx)-flags = MTX_KMUTEX | (isspin ? MTX_ISSPIN : 0); } static void mtxenter(struct rumpuser_mtx *mtx) { - if (!mtx-iskmutex) + if (!(mtx-flags MTX_KMUTEX)) return; assert(mtx-owner == NULL); @@ -321,7 +323,7 @@ static void mtxexit(struct rumpuser_mtx *mtx) { - if (!mtx-iskmutex) + if (!(mtx-flags MTX_KMUTEX)) return; assert(mtx-owner != NULL); @@ -332,6 +334,11 @@ void rumpuser_mutex_enter(struct rumpuser_mtx *mtx) { + if (mtx-flags MTX_ISSPIN) { + rumpuser_mutex_enter_nowrap(mtx); + return; + } + if (pthread_mutex_trylock(mtx-pthmtx) != 0) KLOCK_WRAP(NOFAIL_ERRNO(pthread_mutex_lock(mtx-pthmtx))); mtxenter(mtx); @@ -341,6 +348,7 @@ void rumpuser_mutex_enter_nowrap(struct rumpuser_mtx *mtx) { + assert(mtx-flags MTX_ISSPIN); NOFAIL_ERRNO(pthread_mutex_lock(mtx-pthmtx)); mtxenter(mtx); } @@ -378,7 +386,7 @@ struct lwp * rumpuser_mutex_owner(struct rumpuser_mtx *mtx) { - if (__predict_false(!mtx-iskmutex)) { + if (__predict_false(!(mtx-flags MTX_KMUTEX))) { printf(panic: rumpuser_mutex_held unsupported on non-kmtx\n); abort(); } Index: src/lib/librumpuser/rumpuser_pth_dummy.c diff -u src/lib/librumpuser/rumpuser_pth_dummy.c:1.7 src/lib/librumpuser/rumpuser_pth_dummy.c:1.8 --- src/lib/librumpuser/rumpuser_pth_dummy.c:1.7 Tue Nov 6 18:33:00 2012 +++ src/lib/librumpuser/rumpuser_pth_dummy.c Sat Apr 27 13:59:46 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_pth_dummy.c,v 1.7 2012/11/06 18:33:00 pooka Exp $ */ +/* $NetBSD: rumpuser_pth_dummy.c,v 1.8 2013/04/27 13:59:46 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ #include sys/cdefs.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_pth_dummy.c,v 1.7 2012/11/06 18:33:00 pooka Exp $); +__RCSID($NetBSD: rumpuser_pth_dummy.c,v 1.8 2013/04/27 13:59:46 pooka Exp $); #endif /* !lint */ #include sys/time.h @@ -111,7 +111,7 @@ rumpuser_mutex_init(struct rumpuser_mtx } void -rumpuser_mutex_init_kmutex(struct rumpuser_mtx **mtx) +rumpuser_mutex_init_kmutex(struct rumpuser_mtx **mtx, int isspin) { *mtx = calloc(1, sizeof(struct rumpuser_mtx)); Index: src/sys/rump/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.75 src/sys/rump/include/rump/rumpuser.h:1.76 --- src/sys/rump/include/rump/rumpuser.h:1.75 Fri Mar 8 19:04:28 2013 +++ src/sys/rump/include/rump/rumpuser.h Sat
CVS commit: src/sys/rump/include/rump
Module Name:src Committed By: pooka Date: Sat Apr 27 14:02:17 UTC 2013 Modified Files: src/sys/rump/include/rump: rumpuser.h Log Message: remove prototypes for interfaces no longer provided To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/sys/rump/include/rump/rumpuser.h 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/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.76 src/sys/rump/include/rump/rumpuser.h:1.77 --- src/sys/rump/include/rump/rumpuser.h:1.76 Sat Apr 27 13:59:46 2013 +++ src/sys/rump/include/rump/rumpuser.h Sat Apr 27 14:02:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.76 2013/04/27 13:59:46 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.77 2013/04/27 14:02:17 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -44,9 +44,7 @@ int rumpuser_getversion(void); int rumpuser_daemonize_begin(void); int rumpuser_daemonize_done(int); -struct msghdr; struct pollfd; -struct sockaddr; typedef void (*kernel_lockfn)(int, void *); typedef void (*kernel_unlockfn)(int, int *, void *); @@ -198,20 +196,6 @@ extern struct rumpuser_cv rumpuser_aio_c extern struct rumpuser_aio rumpuser_aios[N_AIOS]; extern int rumpuser_aio_head, rumpuser_aio_tail; -/* rumpuser_net */ - -int rumpuser_net_socket(int, int, int, int *); -int rumpuser_net_sendmsg(int, const struct msghdr *, int, int *); -int rumpuser_net_recvmsg(int, struct msghdr *, int, int *); -int rumpuser_net_connect(int, const struct sockaddr *, int, int *); -int rumpuser_net_bind(int, const struct sockaddr *, int, int *); -int rumpuser_net_accept(int, struct sockaddr *, int *, int *); -int rumpuser_net_listen(int, int, int *); -enum rumpuser_getnametype { RUMPUSER_SOCKNAME, RUMPUSER_PEERNAME }; -int rumpuser_net_getname(int, struct sockaddr *, int *, - enum rumpuser_getnametype, int *); -int rumpuser_net_setsockopt(int, int, int, const void *, int, int *); - /* rumpuser dynloader */ struct modinfo;
CVS commit: src
Module Name:src Committed By: pooka Date: Sat Apr 27 14:59:09 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser.c rumpuser_component.c rumpuser_int.h rumpuser_pth.c rumpuser_pth_dummy.c rumpuser_sp.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: rump.c Log Message: * integrate rumpuser_getversion() with the hypervisor initialization * rename some identifiers to better match reality To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/lib/librumpuser/rumpuser.c cvs rdiff -u -r1.1 -r1.2 src/lib/librumpuser/rumpuser_component.c cvs rdiff -u -r1.4 -r1.5 src/lib/librumpuser/rumpuser_int.h cvs rdiff -u -r1.13 -r1.14 src/lib/librumpuser/rumpuser_pth.c cvs rdiff -u -r1.8 -r1.9 src/lib/librumpuser/rumpuser_pth_dummy.c cvs rdiff -u -r1.51 -r1.52 src/lib/librumpuser/rumpuser_sp.c cvs rdiff -u -r1.77 -r1.78 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.257 -r1.258 src/sys/rump/librump/rumpkern/rump.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.29 src/lib/librumpuser/rumpuser.c:1.30 --- src/lib/librumpuser/rumpuser.c:1.29 Mon Mar 18 21:00:52 2013 +++ src/lib/librumpuser/rumpuser.c Sat Apr 27 14:59:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.29 2013/03/18 21:00:52 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.30 2013/04/27 14:59:08 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser.c,v 1.29 2013/03/18 21:00:52 pooka Exp $); +__RCSID($NetBSD: rumpuser.c,v 1.30 2013/04/27 14:59:08 pooka Exp $); #endif /* !lint */ #include sys/ioctl.h @@ -66,11 +66,41 @@ __RCSID($NetBSD: rumpuser.c,v 1.29 2013 #include rumpuser_int.h +rump_unschedulefn rumpuser__unschedule; +rump_reschedulefn rumpuser__reschedule; + int -rumpuser_getversion(void) +rumpuser_init(int version, + rump_reschedulefn rumpkern_resched, rump_unschedulefn rumpkern_unsched) { - return RUMPUSER_VERSION; + if (version != RUMPUSER_VERSION) { + fprintf(stderr, rumpuser mismatch, kern: %d, hypervisor %d\n, + version, RUMPUSER_VERSION); + return 1; + } + +#ifdef RUMPUSER_USE_RANDOM + uint32_t rv; + int fd; + + if ((fd = open(/dev/urandom, O_RDONLY)) == -1) { + srandom(time(NULL)); + } else { + if (read(fd, rv, sizeof(rv)) != sizeof(rv)) + srandom(time(NULL)); + else + srandom(rv); + close(fd); + } +#endif + + rumpuser__thrinit(); + + rumpuser__unschedule = rumpkern_unsched; + rumpuser__reschedule = rumpkern_resched; + + return 0; } int Index: src/lib/librumpuser/rumpuser_component.c diff -u src/lib/librumpuser/rumpuser_component.c:1.1 src/lib/librumpuser/rumpuser_component.c:1.2 --- src/lib/librumpuser/rumpuser_component.c:1.1 Fri Mar 1 18:15:36 2013 +++ src/lib/librumpuser/rumpuser_component.c Sat Apr 27 14:59:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_component.c,v 1.1 2013/03/01 18:15:36 pooka Exp $ */ +/* $NetBSD: rumpuser_component.c,v 1.2 2013/04/27 14:59:08 pooka Exp $ */ /* * Copyright (c) 2013 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_component.c,v 1.1 2013/03/01 18:15:36 pooka Exp $); +__RCSID($NetBSD: rumpuser_component.c,v 1.2 2013/04/27 14:59:08 pooka Exp $); #endif /* !lint */ /* @@ -47,7 +47,7 @@ rumpuser_component_unschedule(void) { int nlocks; - rumpuser__kunlock(0, nlocks, NULL); + rumpuser__unschedule(0, nlocks, NULL); return (void *)(intptr_t)nlocks; } @@ -56,5 +56,5 @@ rumpuser_component_schedule(void *cookie { int nlocks = (int)(intptr_t)cookie; - rumpuser__klock(nlocks, NULL); + rumpuser__reschedule(nlocks, NULL); } Index: src/lib/librumpuser/rumpuser_int.h diff -u src/lib/librumpuser/rumpuser_int.h:1.4 src/lib/librumpuser/rumpuser_int.h:1.5 --- src/lib/librumpuser/rumpuser_int.h:1.4 Mon Nov 15 15:23:32 2010 +++ src/lib/librumpuser/rumpuser_int.h Sat Apr 27 14:59:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_int.h,v 1.4 2010/11/15 15:23:32 pooka Exp $ */ +/* $NetBSD: rumpuser_int.h,v 1.5 2013/04/27 14:59:08 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -29,18 +29,17 @@ #include rump/rumpuser.h -extern kernel_lockfn rumpuser__klock; -extern kernel_unlockfn rumpuser__kunlock; -extern int rumpuser__wantthreads; +extern rump_unschedulefn rumpuser__unschedule; +extern rump_reschedulefn rumpuser__reschedule; #define seterror(value) do { if (error) *error = value;} while (/*CONSTCOND*/0) #define KLOCK_WRAP(a) \ do { \ int nlocks; \ - rumpuser__kunlock(0, nlocks, NULL);\ + rumpuser__unschedule(0, nlocks, NULL);\ a;\ - rumpuser__klock(nlocks, NULL); \ + rumpuser__reschedule(nlocks, NULL);\ } while (/*CONSTCOND*/0
CVS commit: src
Module Name:src Committed By: pooka Date: Sat Apr 27 15:01:22 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/net/lib/libsockin: rumpcomp_user.c rumpcomp_user.h sockin.c Log Message: rumpuser_poll() is used only by sockin, so make the hypercall private to that component. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/lib/librumpuser/rumpuser.c cvs rdiff -u -r1.78 -r1.79 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/libsockin/rumpcomp_user.c cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libsockin/rumpcomp_user.h cvs rdiff -u -r1.27 -r1.28 src/sys/rump/net/lib/libsockin/sockin.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.30 src/lib/librumpuser/rumpuser.c:1.31 --- src/lib/librumpuser/rumpuser.c:1.30 Sat Apr 27 14:59:08 2013 +++ src/lib/librumpuser/rumpuser.c Sat Apr 27 15:01:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.30 2013/04/27 14:59:08 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.31 2013/04/27 15:01:21 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser.c,v 1.30 2013/04/27 14:59:08 pooka Exp $); +__RCSID($NetBSD: rumpuser.c,v 1.31 2013/04/27 15:01:21 pooka Exp $); #endif /* !lint */ #include sys/ioctl.h @@ -52,7 +52,6 @@ __RCSID($NetBSD: rumpuser.c,v 1.30 2013 #include errno.h #include fcntl.h #include netdb.h -#include poll.h #include signal.h #include stdarg.h #include stdint.h @@ -591,13 +590,6 @@ rumpuser_gethostname(char *name, size_t } int -rumpuser_poll(struct pollfd *fds, int nfds, int timeout, int *error) -{ - - DOCALL_KLOCK(int, (poll(fds, (nfds_t)nfds, timeout))); -} - -int rumpuser_putchar(int c, int *error) { Index: src/sys/rump/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.78 src/sys/rump/include/rump/rumpuser.h:1.79 --- src/sys/rump/include/rump/rumpuser.h:1.78 Sat Apr 27 14:59:09 2013 +++ src/sys/rump/include/rump/rumpuser.h Sat Apr 27 15:01:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.78 2013/04/27 14:59:09 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.79 2013/04/27 15:01:21 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -43,8 +43,6 @@ int rumpuser_daemonize_begin(void); int rumpuser_daemonize_done(int); -struct pollfd; - typedef void (*rump_reschedulefn)(int, void *); typedef void (*rump_unschedulefn)(int, int *, void *); int rumpuser_init(int, rump_reschedulefn, rump_unschedulefn); @@ -109,8 +107,6 @@ int rumpuser_getenv(const char *, char * int rumpuser_gethostname(char *, size_t, int *); -int rumpuser_poll(struct pollfd *, int, int, int *); - int rumpuser_putchar(int, int *); #define RUMPUSER_PID_SELF ((int64_t)-1) Index: src/sys/rump/net/lib/libsockin/rumpcomp_user.c diff -u src/sys/rump/net/lib/libsockin/rumpcomp_user.c:1.2 src/sys/rump/net/lib/libsockin/rumpcomp_user.c:1.3 --- src/sys/rump/net/lib/libsockin/rumpcomp_user.c:1.2 Tue Mar 19 02:07:43 2013 +++ src/sys/rump/net/lib/libsockin/rumpcomp_user.c Sat Apr 27 15:01:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.c,v 1.2 2013/03/19 02:07:43 christos Exp $ */ +/* $NetBSD: rumpcomp_user.c,v 1.3 2013/04/27 15:01:21 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -30,6 +30,7 @@ #include sys/socket.h #include errno.h +#include poll.h #include rump/rumpuser_component.h @@ -165,4 +166,18 @@ rumpcomp_sockin_setsockopt(int s, int le seterror(); return rv; } + +int +rumpcomp_sockin_poll(struct pollfd *fds, int nfds, int timeout, int *error) +{ + void *cookie; + int rv; + + cookie = rumpuser_component_unschedule(); + rv = poll(fds, (nfds_t)nfds, timeout); + rumpuser_component_schedule(cookie); + + seterror(); + return rv; +} #endif Index: src/sys/rump/net/lib/libsockin/rumpcomp_user.h diff -u src/sys/rump/net/lib/libsockin/rumpcomp_user.h:1.1 src/sys/rump/net/lib/libsockin/rumpcomp_user.h:1.2 --- src/sys/rump/net/lib/libsockin/rumpcomp_user.h:1.1 Mon Mar 18 13:14:11 2013 +++ src/sys/rump/net/lib/libsockin/rumpcomp_user.h Sat Apr 27 15:01:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.h,v 1.1 2013/03/18 13:14:11 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.h,v 1.2 2013/04/27 15:01:21 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -40,3 +40,4 @@ int rumpcomp_sockin_listen(int, int, in int rumpcomp_sockin_getname(int, struct sockaddr *, int *, enum rumpcomp_sockin_getnametype, int *); int rumpcomp_sockin_setsockopt(int, int, int, const void *, int, int *); +int rumpcomp_sockin_poll(struct pollfd *, int, int, int *); Index: src/sys/rump/net/lib/libsockin/sockin.c diff -u
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Sat Apr 27 15:13:12 UTC 2013 Modified Files: src/sys/rump/include/rump: rump.h src/sys/rump/librump/rumpkern: rump.c Log Message: Get rid of the rump__init() macro. it was never useful and just makes debugging less obvious. To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/rump/include/rump/rump.h cvs rdiff -u -r1.258 -r1.259 src/sys/rump/librump/rumpkern/rump.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/include/rump/rump.h diff -u src/sys/rump/include/rump/rump.h:1.55 src/sys/rump/include/rump/rump.h:1.56 --- src/sys/rump/include/rump/rump.h:1.55 Wed Nov 21 17:41:27 2012 +++ src/sys/rump/include/rump/rump.h Sat Apr 27 15:13:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.h,v 1.55 2012/11/21 17:41:27 pooka Exp $ */ +/* $NetBSD: rump.h,v 1.56 2013/04/27 15:13:11 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -91,13 +91,6 @@ enum rump_etfs_type { RUMP_ETFS_DIR_SUBDIRS /* dir + subdirectories (recursive) */ }; -/* - * Something like rump capabilities would be nicer, but let's - * do this for a start. - */ -#define RUMP_VERSION 01 -#define rump_init() rump__init(RUMP_VERSION) - /* um, what's the point ?-) */ #ifdef _BEGIN_DECLS _BEGIN_DECLS @@ -113,7 +106,7 @@ void rump_unschedule(void); void rump_printevcnts(void); int rump_daemonize_begin(void); -int rump__init(int); +int rump_init(void); int rump_init_server(const char *); int rump_daemonize_done(int); #define RUMP_DAEMONIZE_SUCCESS 0 Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.258 src/sys/rump/librump/rumpkern/rump.c:1.259 --- src/sys/rump/librump/rumpkern/rump.c:1.258 Sat Apr 27 14:59:09 2013 +++ src/sys/rump/librump/rumpkern/rump.c Sat Apr 27 15:13:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.258 2013/04/27 14:59:09 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.259 2013/04/27 15:13:11 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.258 2013/04/27 14:59:09 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.259 2013/04/27 15:13:11 pooka Exp $); #include sys/systm.h #define ELFSIZE ARCH_ELFSIZE @@ -229,7 +229,7 @@ RUMP_COMPONENT(RUMP_COMPONENT_POSTINIT) } int -rump__init(int rump_version) +rump_init(void) { char buf[256]; struct timespec ts; @@ -281,12 +281,6 @@ rump__init(int rump_version) initmsgbuf(rump_msgbuf, sizeof(rump_msgbuf)); aprint_verbose(%s%s, copyright, version); - if (rump_version != RUMP_VERSION) { - printf(rump version mismatch, %d vs. %d\n, - rump_version, RUMP_VERSION); - return EPROGMISMATCH; - } - rump_intr_init(numcpu); rump_tsleep_init(); @@ -534,6 +528,8 @@ rump__init(int rump_version) return 0; } +/* historic compat */ +__strong_alias(rump__init,rump_init); int rump_init_server(const char *url)
CVS commit: src/sys/rump/include/rump
Module Name:src Committed By: pooka Date: Sat Apr 27 15:32:37 UTC 2013 Modified Files: src/sys/rump/include/rump: rumpuser.h Log Message: Let the includer figure out where to get stdint or equivalent from. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/sys/rump/include/rump/rumpuser.h 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/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.79 src/sys/rump/include/rump/rumpuser.h:1.80 --- src/sys/rump/include/rump/rumpuser.h:1.79 Sat Apr 27 15:01:21 2013 +++ src/sys/rump/include/rump/rumpuser.h Sat Apr 27 15:32:36 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.79 2013/04/27 15:01:21 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.80 2013/04/27 15:32:36 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -28,16 +28,15 @@ #ifndef _RUMP_RUMPUSER_H_ #define _RUMP_RUMPUSER_H_ +/* + * Do not include any headers here! Implementation must take care of + * having stdint or equivalent included before including this header. + */ + #if !defined(_KERNEL) !defined(LIBRUMPUSER) #error The rump/rumpuser.h interface is not for non-kernel consumers #endif -#ifdef _KERNEL -#include sys/stdint.h -#else -#include stdint.h -#endif - #define RUMPUSER_VERSION 16 int rumpuser_daemonize_begin(void);
CVS commit: src
Module Name:src Committed By: pooka Date: Sat Apr 27 15:34:54 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: Makefile.rumpkern memalloc.c vm.c Log Message: * treat kern_malloc.c as an unreal allocator (it's so lightweight) * get rid of the rumpuser_realloc() hypercall * pass size to rumpuser_free() To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/lib/librumpuser/rumpuser.c cvs rdiff -u -r1.80 -r1.81 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.124 -r1.125 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.20 -r1.21 src/sys/rump/librump/rumpkern/memalloc.c cvs rdiff -u -r1.137 -r1.138 src/sys/rump/librump/rumpkern/vm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.31 src/lib/librumpuser/rumpuser.c:1.32 --- src/lib/librumpuser/rumpuser.c:1.31 Sat Apr 27 15:01:21 2013 +++ src/lib/librumpuser/rumpuser.c Sat Apr 27 15:34:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.31 2013/04/27 15:01:21 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.32 2013/04/27 15:34:53 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser.c,v 1.31 2013/04/27 15:01:21 pooka Exp $); +__RCSID($NetBSD: rumpuser.c,v 1.32 2013/04/27 15:34:53 pooka Exp $); #endif /* !lint */ #include sys/ioctl.h @@ -261,15 +261,9 @@ rumpuser_malloc(size_t howmuch, int alig return mem; } -void * -rumpuser_realloc(void *ptr, size_t howmuch) -{ - - return realloc(ptr, howmuch); -} - +/*ARGSUSED1*/ void -rumpuser_free(void *ptr) +rumpuser_free(void *ptr, size_t size) { free(ptr); Index: src/sys/rump/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.80 src/sys/rump/include/rump/rumpuser.h:1.81 --- src/sys/rump/include/rump/rumpuser.h:1.80 Sat Apr 27 15:32:36 2013 +++ src/sys/rump/include/rump/rumpuser.h Sat Apr 27 15:34:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.80 2013/04/27 15:32:36 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.81 2013/04/27 15:34:53 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -55,8 +55,7 @@ int rumpuser_getfileinfo(const char *, u int rumpuser_nanosleep(uint64_t *, uint64_t *, int *); void *rumpuser_malloc(size_t, int); -void *rumpuser_realloc(void *, size_t); -void rumpuser_free(void *); +void rumpuser_free(void *, size_t); void *rumpuser_anonmmap(void *, size_t, int, int, int *); #define RUMPUSER_FILEMMAP_READ 0x01 Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.124 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.125 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.124 Fri Mar 15 12:09:58 2013 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Sat Apr 27 15:34:53 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.124 2013/03/15 12:09:58 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.125 2013/04/27 15:34:53 pooka Exp $ # .include ${RUMPTOP}/Makefile.rump @@ -66,6 +66,7 @@ SRCS+= init_sysctl_base.c \ kern_event.c \ kern_hook.c \ kern_ksyms.c \ + kern_malloc.c \ kern_module.c \ kern_mutex_obj.c \ kern_ntptime.c \ @@ -139,7 +140,7 @@ SRCS+= kern_select_50.c .if defined(RUMP_UNREAL_ALLOCATORS) ${RUMP_UNREAL_ALLOCATORS} == yes SRCS+= memalloc.c .else -SRCS+= kern_malloc.c subr_kmem.c subr_pool.c +SRCS+= subr_kmem.c subr_pool.c .endif .ifdef RUMP_LOCKDEBUG Index: src/sys/rump/librump/rumpkern/memalloc.c diff -u src/sys/rump/librump/rumpkern/memalloc.c:1.20 src/sys/rump/librump/rumpkern/memalloc.c:1.21 --- src/sys/rump/librump/rumpkern/memalloc.c:1.20 Sun Mar 10 17:05:12 2013 +++ src/sys/rump/librump/rumpkern/memalloc.c Sat Apr 27 15:34:53 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: memalloc.c,v 1.20 2013/03/10 17:05:12 pooka Exp $ */ +/* $NetBSD: memalloc.c,v 1.21 2013/04/27 15:34:53 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: memalloc.c,v 1.20 2013/03/10 17:05:12 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: memalloc.c,v 1.21 2013/04/27 15:34:53 pooka Exp $); #include sys/param.h #include sys/kmem.h @@ -44,54 +44,12 @@ __KERNEL_RCSID(0, $NetBSD: memalloc.c,v * libc malloc. * * Supported: - * + malloc * + kmem * + pool * + pool_cache */ /* - * malloc - */ - -void -kmeminit(void) -{ - - return; -} - -void * -kern_malloc(unsigned long size, int flags) -{ - void *rv; - - rv = rumpuser_malloc(size, 0); - - if (__predict_false(rv == NULL (flags (M_CANFAIL|M_NOWAIT)) == 0)) - panic(malloc %lu bytes failed, size); - - if (rv flags M_ZERO) - memset(rv, 0, size); - - return rv
CVS commit: src
Module Name:src Committed By: pooka Date: Sat Apr 27 16:02:56 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_sp.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: rump.c Log Message: wrap unportable register_t with a long. should do it in the front of the house too, but at least this is a start. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/lib/librumpuser/rumpuser_sp.c cvs rdiff -u -r1.81 -r1.82 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.259 -r1.260 src/sys/rump/librump/rumpkern/rump.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_sp.c diff -u src/lib/librumpuser/rumpuser_sp.c:1.52 src/lib/librumpuser/rumpuser_sp.c:1.53 --- src/lib/librumpuser/rumpuser_sp.c:1.52 Sat Apr 27 14:59:08 2013 +++ src/lib/librumpuser/rumpuser_sp.c Sat Apr 27 16:02:56 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_sp.c,v 1.52 2013/04/27 14:59:08 pooka Exp $ */ +/* $NetBSD: rumpuser_sp.c,v 1.53 2013/04/27 16:02:56 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -37,7 +37,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_sp.c,v 1.52 2013/04/27 14:59:08 pooka Exp $); +__RCSID($NetBSD: rumpuser_sp.c,v 1.53 2013/04/27 16:02:56 pooka Exp $); #endif /* !lint */ #include sys/types.h @@ -260,14 +260,17 @@ lwproc_lwpexit(void) } static int -rumpsyscall(int sysnum, void *data, register_t *retval) +rumpsyscall(int sysnum, void *data, register_t *regrv) { + long retval[2] = {0, 0}; int rv; spops.spop_schedule(); rv = spops.spop_syscall(sysnum, data, retval); spops.spop_unschedule(); + regrv[0] = retval[0]; + regrv[1] = retval[1]; return rv; } Index: src/sys/rump/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.81 src/sys/rump/include/rump/rumpuser.h:1.82 --- src/sys/rump/include/rump/rumpuser.h:1.81 Sat Apr 27 15:34:53 2013 +++ src/sys/rump/include/rump/rumpuser.h Sat Apr 27 16:02:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.81 2013/04/27 15:34:53 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.82 2013/04/27 16:02:55 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -209,7 +209,7 @@ struct rumpuser_sp_ops { int (*spop_lwproc_rfork)(void *, int, const char *); int (*spop_lwproc_newlwp)(pid_t); struct lwp * (*spop_lwproc_curlwp)(void); - int (*spop_syscall)(int, void *, register_t *); + int (*spop_syscall)(int, void *, long *); void (*spop_lwpexit)(void); void (*spop_execnotify)(const char *); pid_t (*spop_getpid)(void); Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.259 src/sys/rump/librump/rumpkern/rump.c:1.260 --- src/sys/rump/librump/rumpkern/rump.c:1.259 Sat Apr 27 15:13:11 2013 +++ src/sys/rump/librump/rumpkern/rump.c Sat Apr 27 16:02:56 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.259 2013/04/27 15:13:11 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.260 2013/04/27 16:02:56 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.259 2013/04/27 15:13:11 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.260 2013/04/27 16:02:56 pooka Exp $); #include sys/systm.h #define ELFSIZE ARCH_ELFSIZE @@ -101,7 +101,7 @@ int rump_threads = 0; int rump_threads = 1; #endif -static int rump_proxy_syscall(int, void *, register_t *); +static int rump_proxy_syscall(int, void *, long *); static int rump_proxy_rfork(void *, int, const char *); static void rump_proxy_lwpexit(void); static void rump_proxy_execnotify(const char *); @@ -781,8 +781,9 @@ rump_kernelfsym_load(void *symtab, uint6 } static int -rump_proxy_syscall(int num, void *arg, register_t *retval) +rump_proxy_syscall(int num, void *arg, long *retval) { + register_t regrv[2] = {0, 0}; struct lwp *l; struct sysent *callp; int rv; @@ -792,7 +793,9 @@ rump_proxy_syscall(int num, void *arg, r callp = rump_sysent + num; l = curlwp; - rv = sy_call(callp, l, (void *)arg, retval); + rv = sy_call(callp, l, (void *)arg, regrv); + retval[0] = regrv[0]; + retval[1] = regrv[1]; return rv; }
CVS commit: src/sys/rump/include/rump
Module Name:src Committed By: pooka Date: Sat Apr 27 16:05:55 UTC 2013 Modified Files: src/sys/rump/include/rump: rumpuser.h Log Message: move struct lwp forward decl before its first use. otherwise it's rather pointless. some whitespace landscaping too. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/rump/include/rump/rumpuser.h 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/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.82 src/sys/rump/include/rump/rumpuser.h:1.83 --- src/sys/rump/include/rump/rumpuser.h:1.82 Sat Apr 27 16:02:55 2013 +++ src/sys/rump/include/rump/rumpuser.h Sat Apr 27 16:05:54 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.82 2013/04/27 16:02:55 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.83 2013/04/27 16:05:54 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -130,8 +130,11 @@ int rumpuser_thread_create(void *(*f)(v void rumpuser_thread_exit(void) __dead; int rumpuser_thread_join(void *); -struct rumpuser_mtx; +struct lwp; +void rumpuser_set_curlwp(struct lwp *); +struct lwp *rumpuser_get_curlwp(void); +struct rumpuser_mtx; void rumpuser_mutex_init(struct rumpuser_mtx **); void rumpuser_mutex_init_kmutex(struct rumpuser_mtx **, int); void rumpuser_mutex_enter(struct rumpuser_mtx *); @@ -142,7 +145,6 @@ void rumpuser_mutex_destroy(struct rumpu struct lwp *rumpuser_mutex_owner(struct rumpuser_mtx *); struct rumpuser_rw; - void rumpuser_rw_init(struct rumpuser_rw **); void rumpuser_rw_enter(struct rumpuser_rw *, int); int rumpuser_rw_tryenter(struct rumpuser_rw *, int); @@ -153,7 +155,6 @@ int rumpuser_rw_rdheld(struct rumpuser_ int rumpuser_rw_wrheld(struct rumpuser_rw *); struct rumpuser_cv; - void rumpuser_cv_init(struct rumpuser_cv **); void rumpuser_cv_destroy(struct rumpuser_cv *); void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *); @@ -164,11 +165,6 @@ void rumpuser_cv_signal(struct rumpuser_ void rumpuser_cv_broadcast(struct rumpuser_cv *); int rumpuser_cv_has_waiters(struct rumpuser_cv *); -struct lwp; - -void rumpuser_set_curlwp(struct lwp *); -struct lwp *rumpuser_get_curlwp(void); - /* aio stuff for being able to fire of a B_ASYNC I/O and continue */ struct rumpuser_aio { int rua_fd;
CVS commit: src
Module Name:src Committed By: pooka Date: Sat Apr 27 16:32:58 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_pth.c rumpuser_pth_dummy.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: intr.c locks.c ltsleep.c rump.c scheduler.c threads.c Log Message: roll mutex init hypercalls into one (one of them already took a flag anyway) To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/librumpuser/rumpuser_pth.c cvs rdiff -u -r1.9 -r1.10 src/lib/librumpuser/rumpuser_pth_dummy.c cvs rdiff -u -r1.83 -r1.84 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.36 -r1.37 src/sys/rump/librump/rumpkern/intr.c cvs rdiff -u -r1.56 -r1.57 src/sys/rump/librump/rumpkern/locks.c cvs rdiff -u -r1.29 -r1.30 src/sys/rump/librump/rumpkern/ltsleep.c cvs rdiff -u -r1.260 -r1.261 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.30 -r1.31 src/sys/rump/librump/rumpkern/scheduler.c cvs rdiff -u -r1.18 -r1.19 src/sys/rump/librump/rumpkern/threads.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_pth.c diff -u src/lib/librumpuser/rumpuser_pth.c:1.14 src/lib/librumpuser/rumpuser_pth.c:1.15 --- src/lib/librumpuser/rumpuser_pth.c:1.14 Sat Apr 27 14:59:08 2013 +++ src/lib/librumpuser/rumpuser_pth.c Sat Apr 27 16:32:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_pth.c,v 1.14 2013/04/27 14:59:08 pooka Exp $ */ +/* $NetBSD: rumpuser_pth.c,v 1.15 2013/04/27 16:32:58 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_pth.c,v 1.14 2013/04/27 14:59:08 pooka Exp $); +__RCSID($NetBSD: rumpuser_pth.c,v 1.15 2013/04/27 16:32:58 pooka Exp $); #endif /* !lint */ #include assert.h @@ -58,8 +58,6 @@ do { \ }\ } while (/*CONSTCOND*/0) -#define MTX_KMUTEX 0x1 -#define MTX_ISSPIN 0x2 struct rumpuser_mtx { pthread_mutex_t pthmtx; struct lwp *owner; @@ -252,7 +250,7 @@ rumpuser_thread_join(void *ptcookie) } void -rumpuser_mutex_init(struct rumpuser_mtx **mtx) +rumpuser_mutex_init(struct rumpuser_mtx **mtx, int flags) { pthread_mutexattr_t att; @@ -264,22 +262,15 @@ rumpuser_mutex_init(struct rumpuser_mtx pthread_mutexattr_destroy(att); (*mtx)-owner = NULL; - (*mtx)-flags = MTX_ISSPIN; -} - -void -rumpuser_mutex_init_kmutex(struct rumpuser_mtx **mtx, int isspin) -{ - - rumpuser_mutex_init(mtx); - (*mtx)-flags = MTX_KMUTEX | (isspin ? MTX_ISSPIN : 0); + assert(flags != 0); + (*mtx)-flags = flags; } static void mtxenter(struct rumpuser_mtx *mtx) { - if (!(mtx-flags MTX_KMUTEX)) + if (!(mtx-flags RUMPUSER_MTX_KMUTEX)) return; assert(mtx-owner == NULL); @@ -290,7 +281,7 @@ static void mtxexit(struct rumpuser_mtx *mtx) { - if (!(mtx-flags MTX_KMUTEX)) + if (!(mtx-flags RUMPUSER_MTX_KMUTEX)) return; assert(mtx-owner != NULL); @@ -301,11 +292,12 @@ void rumpuser_mutex_enter(struct rumpuser_mtx *mtx) { - if (mtx-flags MTX_ISSPIN) { + if (mtx-flags RUMPUSER_MTX_SPIN) { rumpuser_mutex_enter_nowrap(mtx); return; } + assert(mtx-flags RUMPUSER_MTX_KMUTEX); if (pthread_mutex_trylock(mtx-pthmtx) != 0) KLOCK_WRAP(NOFAIL_ERRNO(pthread_mutex_lock(mtx-pthmtx))); mtxenter(mtx); @@ -315,7 +307,7 @@ void rumpuser_mutex_enter_nowrap(struct rumpuser_mtx *mtx) { - assert(mtx-flags MTX_ISSPIN); + assert(mtx-flags RUMPUSER_MTX_SPIN); NOFAIL_ERRNO(pthread_mutex_lock(mtx-pthmtx)); mtxenter(mtx); } @@ -353,7 +345,7 @@ struct lwp * rumpuser_mutex_owner(struct rumpuser_mtx *mtx) { - if (__predict_false(!(mtx-flags MTX_KMUTEX))) { + if (__predict_false(!(mtx-flags RUMPUSER_MTX_KMUTEX))) { printf(panic: rumpuser_mutex_held unsupported on non-kmtx\n); abort(); } Index: src/lib/librumpuser/rumpuser_pth_dummy.c diff -u src/lib/librumpuser/rumpuser_pth_dummy.c:1.9 src/lib/librumpuser/rumpuser_pth_dummy.c:1.10 --- src/lib/librumpuser/rumpuser_pth_dummy.c:1.9 Sat Apr 27 14:59:08 2013 +++ src/lib/librumpuser/rumpuser_pth_dummy.c Sat Apr 27 16:32:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_pth_dummy.c,v 1.9 2013/04/27 14:59:08 pooka Exp $ */ +/* $NetBSD: rumpuser_pth_dummy.c,v 1.10 2013/04/27 16:32:58 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ #include sys/cdefs.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_pth_dummy.c,v 1.9 2013/04/27 14:59:08 pooka Exp $); +__RCSID($NetBSD: rumpuser_pth_dummy.c,v 1.10 2013/04/27 16:32:58 pooka Exp $); #endif /* !lint */ #include sys/time.h @@ -99,14 +99,7 @@ rumpuser_thread_exit(void) } void -rumpuser_mutex_init(struct rumpuser_mtx **mtx) -{ - - *mtx = calloc(1, sizeof(struct rumpuser_mtx)); -} - -void -rumpuser_mutex_init_kmutex(struct rumpuser_mtx **mtx, int isspin) +rumpuser_mutex_init(struct rumpuser_mtx **mtx, int flgas
CVS commit: src
Module Name:src Committed By: pooka Date: Sat Apr 27 16:56:30 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser.c rumpuser_port.h rumpuser_sp.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: cprng_stub.c Log Message: make the random hypercall more generic To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/lib/librumpuser/rumpuser.c cvs rdiff -u -r1.16 -r1.17 src/lib/librumpuser/rumpuser_port.h cvs rdiff -u -r1.53 -r1.54 src/lib/librumpuser/rumpuser_sp.c cvs rdiff -u -r1.84 -r1.85 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.4 -r1.5 src/sys/rump/librump/rumpkern/cprng_stub.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.32 src/lib/librumpuser/rumpuser.c:1.33 --- src/lib/librumpuser/rumpuser.c:1.32 Sat Apr 27 15:34:53 2013 +++ src/lib/librumpuser/rumpuser.c Sat Apr 27 16:56:29 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.32 2013/04/27 15:34:53 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.33 2013/04/27 16:56:29 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser.c,v 1.32 2013/04/27 15:34:53 pooka Exp $); +__RCSID($NetBSD: rumpuser.c,v 1.33 2013/04/27 16:56:29 pooka Exp $); #endif /* !lint */ #include sys/ioctl.h @@ -79,7 +79,7 @@ rumpuser_init(int version, return 1; } -#ifdef RUMPUSER_USE_RANDOM +#ifdef RUMPUSER_USE_DEVRANDOM uint32_t rv; int fd; @@ -808,10 +808,21 @@ rumpuser_getnhostcpu(void) return ncpu; } -/* XXX: this hypercall needs a better name */ -uint32_t -rumpuser_arc4random(void) +size_t +rumpuser_getrandom(void *buf, size_t buflen, int flags) { + size_t origlen = buflen; + uint32_t *p = buf; + uint32_t tmp; + int chunk; - return arc4random(); + do { + chunk = buflen 4 ? buflen : 4; /* portable MIN ... */ + tmp = RUMPUSER_RANDOM(); + memcpy(p, tmp, chunk); + p++; + buflen -= chunk; + } while (chunk); + + return origlen; } Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.16 src/lib/librumpuser/rumpuser_port.h:1.17 --- src/lib/librumpuser/rumpuser_port.h:1.16 Wed Mar 20 12:59:10 2013 +++ src/lib/librumpuser/rumpuser_port.h Sat Apr 27 16:56:29 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_port.h,v 1.16 2013/03/20 12:59:10 pooka Exp $ */ +/* $NetBSD: rumpuser_port.h,v 1.17 2013/04/27 16:56:29 pooka Exp $ */ /* * Portability header for non-NetBSD platforms. @@ -151,8 +151,10 @@ posix_memalign(void **ptr, size_t align, #endif #if defined(__linux__) || defined(__sun__) || defined (__CYGWIN__) -#define arc4random() random() -#define RUMPUSER_USE_RANDOM +#define RUMPUSER_RANDOM() random() +#define RUMPUSER_USE_DEVRANDOM +#else +#define RUMPUSER_RANDOM() arc4random() #endif #ifndef __NetBSD_Prereq__ Index: src/lib/librumpuser/rumpuser_sp.c diff -u src/lib/librumpuser/rumpuser_sp.c:1.53 src/lib/librumpuser/rumpuser_sp.c:1.54 --- src/lib/librumpuser/rumpuser_sp.c:1.53 Sat Apr 27 16:02:56 2013 +++ src/lib/librumpuser/rumpuser_sp.c Sat Apr 27 16:56:29 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_sp.c,v 1.53 2013/04/27 16:02:56 pooka Exp $ */ +/* $NetBSD: rumpuser_sp.c,v 1.54 2013/04/27 16:56:29 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -37,7 +37,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_sp.c,v 1.53 2013/04/27 16:02:56 pooka Exp $); +__RCSID($NetBSD: rumpuser_sp.c,v 1.54 2013/04/27 16:56:29 pooka Exp $); #endif /* !lint */ #include sys/types.h @@ -1104,9 +1104,8 @@ handlereq(struct spclient *spc) } /* Ok, we have a new process context and a new curlwp */ - for (i = 0; i AUTHLEN; i++) { - pf-pf_auth[i] = auth[i] = arc4random(); - } + rumpuser_getrandom(auth, sizeof(auth), 0); + memcpy(pf-pf_auth, auth, sizeof(pf-pf_auth)); pf-pf_lwp = lwproc_curlwp(); lwproc_switch(NULL); Index: src/sys/rump/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.84 src/sys/rump/include/rump/rumpuser.h:1.85 --- src/sys/rump/include/rump/rumpuser.h:1.84 Sat Apr 27 16:32:56 2013 +++ src/sys/rump/include/rump/rumpuser.h Sat Apr 27 16:56:30 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.84 2013/04/27 16:32:56 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.85 2013/04/27 16:56:30 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -121,7 +121,10 @@ int rumpuser_dprintf(const char *, ...) int rumpuser_getnhostcpu(void); -uint32_t rumpuser_arc4random(void); +/* always succeeds unless NOWAIT is given */ +#define RUMPUSER_RANDOM_HARD 0x01 +#define RUMPUSER_RANDOM_NOWAIT 0x02 +size_t rumpuser_getrandom(void *, size_t, int); __dead void rumpuser_biothread(void *); Index: src/sys/rump/librump/rumpkern
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sat Apr 27 22:26:57 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: scheduler.c Log Message: Make sure spin mutexes get allocated as spin mutexes (the hypervisor asserts it now). To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/rump/librump/rumpkern/scheduler.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/scheduler.c diff -u src/sys/rump/librump/rumpkern/scheduler.c:1.31 src/sys/rump/librump/rumpkern/scheduler.c:1.32 --- src/sys/rump/librump/rumpkern/scheduler.c:1.31 Sat Apr 27 16:32:57 2013 +++ src/sys/rump/librump/rumpkern/scheduler.c Sat Apr 27 22:26:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: scheduler.c,v 1.31 2013/04/27 16:32:57 pooka Exp $ */ +/* $NetBSD: scheduler.c,v 1.32 2013/04/27 22:26:57 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: scheduler.c,v 1.31 2013/04/27 16:32:57 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: scheduler.c,v 1.32 2013/04/27 22:26:57 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -165,14 +165,14 @@ rump_scheduler_init(int numcpu) ci = rump_cpus[i]; rcpu-rcpu_ci = ci; ci-ci_schedstate.spc_mutex = - mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE); + mutex_obj_alloc(MUTEX_DEFAULT, IPL_SCHED); ci-ci_schedstate.spc_flags = SPCF_RUNNING; rcpu-rcpu_wanted = 0; rumpuser_cv_init(rcpu-rcpu_cv); rumpuser_mutex_init(rcpu-rcpu_mtx, RUMPUSER_MTX_SPIN); } - mutex_init(unruntime_lock, MUTEX_DEFAULT, IPL_NONE); + mutex_init(unruntime_lock, MUTEX_DEFAULT, IPL_SCHED); } /*
CVS commit: src/sys/rump/kern/lib/libsys_cygwin
Module Name:src Committed By: pooka Date: Wed Apr 10 16:44:55 UTC 2013 Added Files: src/sys/rump/kern/lib/libsys_cygwin: Makefile component.c rump_cygwin_compat.c shlib_version syscalls.conf syscalls.master Log Message: cygwin compat To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/rump/kern/lib/libsys_cygwin/Makefile \ src/sys/rump/kern/lib/libsys_cygwin/component.c \ src/sys/rump/kern/lib/libsys_cygwin/rump_cygwin_compat.c \ src/sys/rump/kern/lib/libsys_cygwin/shlib_version \ src/sys/rump/kern/lib/libsys_cygwin/syscalls.conf \ src/sys/rump/kern/lib/libsys_cygwin/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/rump/kern/lib/libsys_cygwin/Makefile diff -u /dev/null src/sys/rump/kern/lib/libsys_cygwin/Makefile:1.1 --- /dev/null Wed Apr 10 16:44:55 2013 +++ src/sys/rump/kern/lib/libsys_cygwin/Makefile Wed Apr 10 16:44:54 2013 @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2013/04/10 16:44:54 pooka Exp $ +# + +LIB= rumpkern_sys_cygwin + +SRCS= rump_cygwin_compat.c rump_cygwin_sysent.c component.c + +# XXX +CPPFLAGS+= -I${.CURDIR} -I${RUMPTOP}/librump/rumpkern + +.include bsd.lib.mk +.include bsd.klinks.mk Index: src/sys/rump/kern/lib/libsys_cygwin/component.c diff -u /dev/null src/sys/rump/kern/lib/libsys_cygwin/component.c:1.1 --- /dev/null Wed Apr 10 16:44:55 2013 +++ src/sys/rump/kern/lib/libsys_cygwin/component.c Wed Apr 10 16:44:54 2013 @@ -0,0 +1,31 @@ +/* $NetBSD: component.c,v 1.1 2013/04/10 16:44:54 pooka Exp $ */ + +#include sys/param.h +#include sys/proc.h + +#include uvm/uvm_extern.h + +#include rump_private.h + +#include rump_cygwin_syscall.h + +extern struct sysent rump_cygwin_sysent[]; + +struct emul emul_rump_sys_cygwin = { + .e_name = cygwin-rump, + .e_sysent = rump_cygwin_sysent, +#ifndef __HAVE_MINIMAL_EMUL + .e_nsysent = RUMP_CYGWIN_SYS_NSYSENT, +#endif + .e_vm_default_addr = uvm_default_mapaddr, +#ifdef __HAVE_SYSCALL_INTERN + .e_syscall_intern = syscall_intern, +#endif +}; + +RUMP_COMPONENT(RUMP_COMPONENT_KERN) +{ + extern struct emul *emul_default; + + emul_default = emul_rump_sys_cygwin; +} Index: src/sys/rump/kern/lib/libsys_cygwin/rump_cygwin_compat.c diff -u /dev/null src/sys/rump/kern/lib/libsys_cygwin/rump_cygwin_compat.c:1.1 --- /dev/null Wed Apr 10 16:44:55 2013 +++ src/sys/rump/kern/lib/libsys_cygwin/rump_cygwin_compat.c Wed Apr 10 16:44:54 2013 @@ -0,0 +1,251 @@ +/* $NetBSD: rump_cygwin_compat.c,v 1.1 2013/04/10 16:44:54 pooka Exp $ */ + +/* + * Copyright (c) 2013 Antti Kantee. All Rights Reserved. + * + * 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 AUTHOR ``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 AUTHOR 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/param.h +#include sys/dirent.h +#include sys/fcntl.h +#include sys/file.h +#include sys/filedesc.h +#include sys/malloc.h +#include sys/namei.h +#include sys/stat.h +#include sys/syscallargs.h +#include sys/vnode.h +#include sys/vfs_syscalls.h + +#include compat/sys/time_types.h + +#include rump_cygwin_syscallargs.h + +struct cygwin_stat { +int st_dev; +int64_t st_ino; +int st_mode; +unsigned short st_nlink; +int st_uid; +int st_gid; +int st_rdev; +off_t st_size; + +struct timespec50 st_atim; +struct timespec50 st_mtim; +struct timespec50 st_ctim; + +long st_blksize; +uint64_t st_blocks; + +struct timespec50 st_btim; +}; + +#define PARCOPY(a) ssb-a = sb-a +static void +bsd_to_cygwin_stat(const struct stat *sb, struct cygwin_stat *ssb) +{ + + memset(ssb, 0, sizeof(*ssb)); + PARCOPY(st_dev); + PARCOPY(st_ino); + PARCOPY(st_mode); + PARCOPY(st_nlink); + PARCOPY(st_uid); + PARCOPY(st_gid); + PARCOPY
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: pooka Date: Tue Apr 9 08:00:20 UTC 2013 Modified Files: src/sys/compat/linux/common: linux_misc.c Log Message: Fix COMPAT_LINUX32. To generate a diff of this commit: cvs rdiff -u -r1.221 -r1.222 src/sys/compat/linux/common/linux_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/linux/common/linux_misc.c diff -u src/sys/compat/linux/common/linux_misc.c:1.221 src/sys/compat/linux/common/linux_misc.c:1.222 --- src/sys/compat/linux/common/linux_misc.c:1.221 Mon Apr 8 20:54:49 2013 +++ src/sys/compat/linux/common/linux_misc.c Tue Apr 9 08:00:20 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.221 2013/04/08 20:54:49 pooka Exp $ */ +/* $NetBSD: linux_misc.c,v 1.222 2013/04/09 08:00:20 pooka Exp $ */ /*- * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: linux_misc.c,v 1.221 2013/04/08 20:54:49 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: linux_misc.c,v 1.222 2013/04/09 08:00:20 pooka Exp $); #include sys/param.h #include sys/systm.h @@ -1378,7 +1378,6 @@ linux_sys_getpriority(struct lwp *l, con return 0; } -#endif /* !COMPAT_LINUX32 */ int linux_sys_utimes(struct lwp *l, const struct linux_sys_utimes_args *uap, register_t *retval) @@ -1436,3 +1435,4 @@ linux_sys_lutimes(struct lwp *l, const s return do_sys_utimes(l, NULL, SCARG(uap, path), NOFOLLOW, tptr, UIO_SYSSPACE); } +#endif /* !COMPAT_LINUX32 */
CVS commit: src/sys/rump/kern/lib/libsys_sunos
Module Name:src Committed By: pooka Date: Tue Apr 9 13:08:33 UTC 2013 Added Files: src/sys/rump/kern/lib/libsys_sunos: Makefile component.c rump_sunos_compat.c shlib_version syscalls.conf syscalls.master Log Message: Add enough syscall compat for fs-utils to work on modern Solaris and derivatives. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/rump/kern/lib/libsys_sunos/Makefile \ src/sys/rump/kern/lib/libsys_sunos/component.c \ src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c \ src/sys/rump/kern/lib/libsys_sunos/shlib_version \ src/sys/rump/kern/lib/libsys_sunos/syscalls.conf \ src/sys/rump/kern/lib/libsys_sunos/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/rump/kern/lib/libsys_sunos/Makefile diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/Makefile:1.1 --- /dev/null Tue Apr 9 13:08:33 2013 +++ src/sys/rump/kern/lib/libsys_sunos/Makefile Tue Apr 9 13:08:33 2013 @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2013/04/09 13:08:33 pooka Exp $ +# + +LIB= rumpkern_sys_sunos + +SRCS= rump_sunos_compat.c rump_sunos_sysent.c component.c + +# XXX +CPPFLAGS+= -I${.CURDIR} -I${RUMPTOP}/librump/rumpkern + +.include bsd.lib.mk +.include bsd.klinks.mk Index: src/sys/rump/kern/lib/libsys_sunos/component.c diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/component.c:1.1 --- /dev/null Tue Apr 9 13:08:33 2013 +++ src/sys/rump/kern/lib/libsys_sunos/component.c Tue Apr 9 13:08:33 2013 @@ -0,0 +1,31 @@ +/* $NetBSD: component.c,v 1.1 2013/04/09 13:08:33 pooka Exp $ */ + +#include sys/param.h +#include sys/proc.h + +#include uvm/uvm_extern.h + +#include rump_private.h + +#include rump_sunos_syscall.h + +extern struct sysent rump_sunos_sysent[]; + +struct emul emul_rump_sys_sunos = { + .e_name = sunos-rump, + .e_sysent = rump_sunos_sysent, +#ifndef __HAVE_MINIMAL_EMUL + .e_nsysent = RUMP_SUNOS_SYS_NSYSENT, +#endif + .e_vm_default_addr = uvm_default_mapaddr, +#ifdef __HAVE_SYSCALL_INTERN + .e_syscall_intern = syscall_intern, +#endif +}; + +RUMP_COMPONENT(RUMP_COMPONENT_KERN) +{ + extern struct emul *emul_default; + + emul_default = emul_rump_sys_sunos; +} Index: src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c diff -u /dev/null src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c:1.1 --- /dev/null Tue Apr 9 13:08:33 2013 +++ src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c Tue Apr 9 13:08:33 2013 @@ -0,0 +1,377 @@ +/* $NetBSD: rump_sunos_compat.c,v 1.1 2013/04/09 13:08:33 pooka Exp $ */ + +/* + * Copyright (c) 2013 Antti Kantee. All Rights Reserved. + * + * 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 AUTHOR ``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 AUTHOR 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/param.h +#include sys/dirent.h +#include sys/fcntl.h +#include sys/file.h +#include sys/filedesc.h +#include sys/malloc.h +#include sys/namei.h +#include sys/stat.h +#include sys/syscallargs.h +#include sys/vnode.h +#include sys/vfs_syscalls.h + +#include compat/sys/time_types.h + +#include rump_sunos_syscallargs.h + +#define SUNOS_MAXNAMLEN 255 + +struct sunos_dirent { + uint64_t d_fileno; + int64_t d_off; + unsigned short d_reclen; + char d_name[SUNOS_MAXNAMLEN + 1]; +}; + +#define SUNOS_NAMEOFF(dp) ((char *)(dp)-d_name - (char *)dp) +#define SUNOS_RECLEN(de,namlen) ALIGN((SUNOS_NAMEOFF(de) + (namlen) + 1)) + +/* + * Rump kernels always use the _FILE_OFFSET_BITS=64 API. + */ +#ifdef __LP64__ +struct sunos_stat { +unsigned long st_dev; +uint64_t st_ino; +unsigned int st_mode; +unsigned int st_nlink; +unsigned int st_uid; +unsigned int st_gid; +unsigned long st_rdev; +off_t st_size; + +struct timespec
CVS commit: src/sys
Module Name:src Committed By: pooka Date: Mon Apr 8 20:54:49 UTC 2013 Modified Files: src/sys/compat/linux/arch/amd64: syscalls.master src/sys/compat/linux/arch/arm: syscalls.master src/sys/compat/linux/arch/i386: syscalls.master src/sys/compat/linux/arch/m68k: syscalls.master src/sys/compat/linux/arch/mips: syscalls.master src/sys/compat/linux/arch/powerpc: syscalls.master src/sys/compat/linux/common: linux_misc.c src/sys/rump/kern/lib/libsys_linux: syscalls.master Log Message: support utimes on non-alpha linux platforms To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/compat/linux/arch/amd64/syscalls.master cvs rdiff -u -r1.49 -r1.50 src/sys/compat/linux/arch/arm/syscalls.master cvs rdiff -u -r1.108 -r1.109 src/sys/compat/linux/arch/i386/syscalls.master cvs rdiff -u -r1.74 -r1.75 src/sys/compat/linux/arch/m68k/syscalls.master cvs rdiff -u -r1.44 -r1.45 src/sys/compat/linux/arch/mips/syscalls.master cvs rdiff -u -r1.51 -r1.52 src/sys/compat/linux/arch/powerpc/syscalls.master cvs rdiff -u -r1.220 -r1.221 src/sys/compat/linux/common/linux_misc.c cvs rdiff -u -r1.3 -r1.4 src/sys/rump/kern/lib/libsys_linux/syscalls.master 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/linux/arch/amd64/syscalls.master diff -u src/sys/compat/linux/arch/amd64/syscalls.master:1.41 src/sys/compat/linux/arch/amd64/syscalls.master:1.42 --- src/sys/compat/linux/arch/amd64/syscalls.master:1.41 Wed Sep 19 21:19:14 2012 +++ src/sys/compat/linux/arch/amd64/syscalls.master Mon Apr 8 20:54:47 2013 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.41 2012/09/19 21:19:14 pooka Exp $ + $NetBSD: syscalls.master,v 1.42 2013/04/08 20:54:47 pooka Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -440,7 +440,7 @@ 232 UNIMPL epoll_wait 233 UNIMPL epoll_ctl 234 STD { int|linux_sys||tgkill(int tgid, int tid, int sig); } -235 UNIMPL utimes +235 STD { int|linux_sys||utimes(const char *path, struct linux_timeval *times); } 236 UNIMPL vserver 237 UNIMPL mbind 238 UNIMPL set_mempolicy Index: src/sys/compat/linux/arch/arm/syscalls.master diff -u src/sys/compat/linux/arch/arm/syscalls.master:1.49 src/sys/compat/linux/arch/arm/syscalls.master:1.50 --- src/sys/compat/linux/arch/arm/syscalls.master:1.49 Wed Sep 19 21:19:14 2012 +++ src/sys/compat/linux/arch/arm/syscalls.master Mon Apr 8 20:54:48 2013 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.49 2012/09/19 21:19:14 pooka Exp $ + $NetBSD: syscalls.master,v 1.50 2013/04/08 20:54:48 pooka Exp $ ; Derived from sys/compat/linux/arch/*/syscalls.master ; and from Linux 2.4.12 arch/arm/kernel/calls.S @@ -449,7 +449,7 @@ 267 STD { int|linux_sys||fstatfs64(int fd, \ size_t sz, struct linux_statfs64 *sp); } 268 STD { int|linux_sys||tgkill(int tgid, int tid, int sig); } -269 UNIMPL utimes +269 STD { int|linux_sys||utimes(const char *path, struct linux_timeval *times); } 270 STD { int|linux_sys||fadvise64_64(int fd, \ linux_off_t offset, linux_off_t len, int advice); } 271 UNIMPL pciconfig_iobase Index: src/sys/compat/linux/arch/i386/syscalls.master diff -u src/sys/compat/linux/arch/i386/syscalls.master:1.108 src/sys/compat/linux/arch/i386/syscalls.master:1.109 --- src/sys/compat/linux/arch/i386/syscalls.master:1.108 Wed Sep 19 21:19:14 2012 +++ src/sys/compat/linux/arch/i386/syscalls.master Mon Apr 8 20:54:48 2013 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.108 2012/09/19 21:19:14 pooka Exp $ + $NetBSD: syscalls.master,v 1.109 2013/04/08 20:54:48 pooka Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -451,7 +451,7 @@ 269 STD { int|linux_sys||fstatfs64(int fd, \ size_t sz, struct linux_statfs64 *sp); } 270 STD { int|linux_sys||tgkill(int tgid, int tid, int sig); } -271 UNIMPL utimes +271 STD { int|linux_sys||utimes(const char *path, struct linux_timeval *times); } 272 STD { int|linux_sys||fadvise64_64(int fd, \ linux_off_t offset, linux_off_t len, int advice); } 273 UNIMPL vserver Index: src/sys/compat/linux/arch/m68k/syscalls.master diff -u src/sys/compat/linux/arch/m68k/syscalls.master:1.74 src/sys/compat/linux/arch/m68k/syscalls.master:1.75 --- src/sys/compat/linux/arch/m68k/syscalls.master:1.74 Wed Sep 19 21:19:14 2012 +++ src/sys/compat/linux/arch/m68k/syscalls.master Mon Apr 8 20:54:48 2013 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.74 2012/09/19 21:19:14 pooka Exp $ + $NetBSD: syscalls.master,v 1.75 2013/04/08 20:54:48 pooka Exp $ ; @(#)syscalls.master 8.1 (Berkeley) 7/19/93 @@ -461,7 +461,7 @@ 264 STD { int|linux_sys||fstatfs64(int fd, \ size_t sz, struct linux_statfs64 *sp); } 265 STD { int|linux_sys||tgkill(int tgid, int tid, int sig); } -266 UNIMPL utimes +266 STD { int|linux_sys||utimes(const char *path, struct linux_timeval *times); } 267 STD { int|linux_sys||fadvise64_64(int fd,
CVS commit: src/sys
Module Name:src Committed By: pooka Date: Mon Apr 8 20:58:27 UTC 2013 Modified Files: src/sys/compat/linux/arch/amd64: linux_syscall.h linux_syscallargs.h linux_syscalls.c linux_sysent.c src/sys/compat/linux/arch/arm: linux_syscall.h linux_syscallargs.h linux_syscalls.c linux_sysent.c src/sys/compat/linux/arch/i386: linux_syscall.h linux_syscallargs.h linux_syscalls.c linux_sysent.c src/sys/compat/linux/arch/m68k: linux_syscall.h linux_syscallargs.h linux_syscalls.c linux_sysent.c src/sys/compat/linux/arch/mips: linux_syscall.h linux_syscallargs.h linux_syscalls.c linux_sysent.c src/sys/compat/linux/arch/powerpc: linux_syscall.h linux_syscallargs.h linux_syscalls.c linux_sysent.c src/sys/rump/kern/lib/libsys_linux: rump_linux_syscall.h rump_linux_syscallargs.h rump_linux_syscalls.c rump_linux_sysent.c Log Message: regen for utimes To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/compat/linux/arch/amd64/linux_syscall.h \ src/sys/compat/linux/arch/amd64/linux_syscallargs.h \ src/sys/compat/linux/arch/amd64/linux_syscalls.c \ src/sys/compat/linux/arch/amd64/linux_sysent.c cvs rdiff -u -r1.52 -r1.53 src/sys/compat/linux/arch/arm/linux_syscall.h \ src/sys/compat/linux/arch/arm/linux_syscallargs.h \ src/sys/compat/linux/arch/arm/linux_syscalls.c \ src/sys/compat/linux/arch/arm/linux_sysent.c cvs rdiff -u -r1.93 -r1.94 src/sys/compat/linux/arch/i386/linux_syscall.h \ src/sys/compat/linux/arch/i386/linux_syscallargs.h \ src/sys/compat/linux/arch/i386/linux_sysent.c cvs rdiff -u -r1.94 -r1.95 src/sys/compat/linux/arch/i386/linux_syscalls.c cvs rdiff -u -r1.80 -r1.81 src/sys/compat/linux/arch/m68k/linux_syscall.h \ src/sys/compat/linux/arch/m68k/linux_syscalls.c \ src/sys/compat/linux/arch/m68k/linux_sysent.c cvs rdiff -u -r1.79 -r1.80 src/sys/compat/linux/arch/m68k/linux_syscallargs.h cvs rdiff -u -r1.49 -r1.50 src/sys/compat/linux/arch/mips/linux_syscall.h cvs rdiff -u -r1.48 -r1.49 src/sys/compat/linux/arch/mips/linux_syscallargs.h \ src/sys/compat/linux/arch/mips/linux_syscalls.c \ src/sys/compat/linux/arch/mips/linux_sysent.c cvs rdiff -u -r1.57 -r1.58 src/sys/compat/linux/arch/powerpc/linux_syscall.h \ src/sys/compat/linux/arch/powerpc/linux_sysent.c cvs rdiff -u -r1.56 -r1.57 \ src/sys/compat/linux/arch/powerpc/linux_syscallargs.h \ src/sys/compat/linux/arch/powerpc/linux_syscalls.c cvs rdiff -u -r1.1 -r1.2 \ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h cvs rdiff -u -r1.4 -r1.5 \ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h \ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c \ src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.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/linux/arch/amd64/linux_syscall.h diff -u src/sys/compat/linux/arch/amd64/linux_syscall.h:1.43 src/sys/compat/linux/arch/amd64/linux_syscall.h:1.44 --- src/sys/compat/linux/arch/amd64/linux_syscall.h:1.43 Wed Sep 19 21:24:36 2012 +++ src/sys/compat/linux/arch/amd64/linux_syscall.h Mon Apr 8 20:58:21 2013 @@ -1,10 +1,10 @@ -/* $NetBSD: linux_syscall.h,v 1.43 2012/09/19 21:24:36 pooka Exp $ */ +/* $NetBSD: linux_syscall.h,v 1.44 2013/04/08 20:58:21 pooka Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.41 2012/09/19 21:19:14 pooka Exp + * created from NetBSD: syscalls.master,v 1.42 2013/04/08 20:54:47 pooka Exp */ #ifndef _LINUX_SYS_SYSCALL_H_ @@ -591,6 +591,9 @@ /* syscall: tgkill ret: int args: int int int */ #define LINUX_SYS_tgkill 234 +/* syscall: utimes ret: int args: const char * struct linux_timeval * */ +#define LINUX_SYS_utimes 235 + /* syscall: ppoll ret: int args: struct pollfd * int struct linux_timespec * linux_sigset_t * */ #define LINUX_SYS_ppoll 271 Index: src/sys/compat/linux/arch/amd64/linux_syscallargs.h diff -u src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.43 src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.44 --- src/sys/compat/linux/arch/amd64/linux_syscallargs.h:1.43 Wed Sep 19 21:24:36 2012 +++ src/sys/compat/linux/arch/amd64/linux_syscallargs.h Mon Apr 8 20:58:21 2013 @@ -1,10 +1,10 @@ -/* $NetBSD: linux_syscallargs.h,v 1.43 2012/09/19 21:24:36 pooka Exp $ */ +/* $NetBSD: linux_syscallargs.h,v 1.44 2013/04/08 20:58:21 pooka Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.41 2012/09/19 21:19:14 pooka Exp + * created from NetBSD: syscalls.master,v 1.42 2013/04/08 20:54:47 pooka Exp */ #ifndef _LINUX_SYS_SYSCALLARGS_H_ @@ -892,6 +892,12 @@ struct linux_sys_tgkill_args { };
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Apr 4 11:21:37 UTC 2013 Modified Files: src/sys/rump/librump/rumpvfs: rump_vfs.c Log Message: create /dev/null only after it's possible to create /dev/null To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/rump/librump/rumpvfs/rump_vfs.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/rumpvfs/rump_vfs.c diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.72 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.73 --- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.72 Wed Apr 3 20:23:01 2013 +++ src/sys/rump/librump/rumpvfs/rump_vfs.c Thu Apr 4 11:21:37 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_vfs.c,v 1.72 2013/04/03 20:23:01 pooka Exp $ */ +/* $NetBSD: rump_vfs.c,v 1.73 2013/04/04 11:21:37 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.72 2013/04/03 20:23:01 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.73 2013/04/04 11:21:37 pooka Exp $); #include sys/param.h #include sys/buf.h @@ -143,7 +143,6 @@ RUMP_COMPONENT(RUMP__FACTION_VFS) /* mtree: create /dev */ do_sys_mkdir(/dev, 0777, UIO_SYSSPACE); - rump_devnull_init(); rump_proc_vfs_init = pvfs_init; rump_proc_vfs_release = pvfs_rele; @@ -195,6 +194,9 @@ RUMP_COMPONENT(RUMP__FACTION_VFS) rump_vfs_builddevs(NULL, 0); #endif + /* attach null device and create /dev/{null,zero} */ + rump_devnull_init(); + rump_component_init(RUMP_COMPONENT_VFS); }
CVS commit: src/sys/rump/dev/lib/libpad
Module Name:src Committed By: pooka Date: Thu Apr 4 11:28:02 UTC 2013 Modified Files: src/sys/rump/dev/lib/libpad: component.c Log Message: create /dev/pad[0-3] instead of just /dev/pad To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/lib/libpad/component.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/dev/lib/libpad/component.c diff -u src/sys/rump/dev/lib/libpad/component.c:1.1 src/sys/rump/dev/lib/libpad/component.c:1.2 --- src/sys/rump/dev/lib/libpad/component.c:1.1 Thu Apr 4 01:41:51 2013 +++ src/sys/rump/dev/lib/libpad/component.c Thu Apr 4 11:28:02 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: component.c,v 1.1 2013/04/04 01:41:51 pooka Exp $ */ +/* $NetBSD: component.c,v 1.2 2013/04/04 11:28:02 pooka Exp $ */ /*- * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: component.c,v 1.1 2013/04/04 01:41:51 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: component.c,v 1.2 2013/04/04 11:28:02 pooka Exp $); #include sys/param.h #include sys/conf.h @@ -40,6 +40,7 @@ RUMP_COMPONENT(RUMP_COMPONENT_DEV) { int error; - if ((error = rump_vfs_makeonedevnode(S_IFCHR, /dev/pad, 189, 0)) != 0) +if ((error = rump_vfs_makedevnodes(S_IFCHR, + /dev/pad, '0', 189, 0, 4)) != 0) panic(cannot create pad device: %d, error); }
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Wed Apr 3 20:23:02 UTC 2013 Modified Files: src/sys/rump/librump/rumpvfs: rump_vfs.c Log Message: Don't create a huge number of unnecessary device nodes automatically. Creating them takes 70-or-so ms on a RPi, and can almost double the bootstrap time of a rump kernel on that hardware. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/rump/librump/rumpvfs/rump_vfs.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/rumpvfs/rump_vfs.c diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.71 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.72 --- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.71 Mon Jan 14 16:45:47 2013 +++ src/sys/rump/librump/rumpvfs/rump_vfs.c Wed Apr 3 20:23:01 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_vfs.c,v 1.71 2013/01/14 16:45:47 pooka Exp $ */ +/* $NetBSD: rump_vfs.c,v 1.72 2013/04/03 20:23:01 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.71 2013/01/14 16:45:47 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.72 2013/04/03 20:23:01 pooka Exp $); #include sys/param.h #include sys/buf.h @@ -91,8 +91,6 @@ drainbufs(int npages) RUMP_COMPONENT(RUMP__FACTION_VFS) { - extern struct devsw_conv devsw_conv0[]; - extern int max_devsw_convs; extern struct vfsops rumpfs_vfsops; char buf[64]; int error; @@ -180,7 +178,22 @@ RUMP_COMPONENT(RUMP__FACTION_VFS) module_init_class(MODULE_CLASS_VFS); + /* + * Don't build device names for a large set of devices by + * default. While the pseudo-devfs is a fun experiment, + * creating many many device nodes may increase rump kernel + * bootstrap time by ~40%. Device nodes should be created + * per-demand in the component constructors. + */ +#if 0 + { + extern struct devsw_conv devsw_conv0[]; + extern int max_devsw_convs; rump_vfs_builddevs(devsw_conv0, max_devsw_convs); + } +#else + rump_vfs_builddevs(NULL, 0); +#endif rump_component_init(RUMP_COMPONENT_VFS); }
CVS commit: src/sys/rump/kern/lib/libsys_linux
Module Name:src Committed By: pooka Date: Wed Apr 3 22:43:56 UTC 2013 Modified Files: src/sys/rump/kern/lib/libsys_linux: component.c Log Message: add a few arch-specific stubs to make this link on arm To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/rump/kern/lib/libsys_linux/component.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/kern/lib/libsys_linux/component.c diff -u src/sys/rump/kern/lib/libsys_linux/component.c:1.6 src/sys/rump/kern/lib/libsys_linux/component.c:1.7 --- src/sys/rump/kern/lib/libsys_linux/component.c:1.6 Thu Mar 7 19:10:59 2013 +++ src/sys/rump/kern/lib/libsys_linux/component.c Wed Apr 3 22:43:56 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: component.c,v 1.6 2013/03/07 19:10:59 pooka Exp $ */ +/* $NetBSD: component.c,v 1.7 2013/04/03 22:43:56 pooka Exp $ */ #include sys/param.h #include sys/proc.h @@ -79,3 +79,7 @@ __weak_alias(oss_ioctl_sequencer,rumplin __weak_alias(oss_ioctl_audio,rumplinux__stub); __weak_alias(rusage_to_rusage50,rumplinux__stub); __weak_alias(do_sys_wait,rumplinux__stub); + +/* arch-specific */ +__weak_alias(compat_offseterr,rumplinux__stub); +__weak_alias(linux_sys_ptrace_arch,rumplinux__stub);
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Apr 4 01:29:55 UTC 2013 Modified Files: src/sys/rump/librump/rumpvfs: devnull.c Log Message: create null devices To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/rump/librump/rumpvfs/devnull.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/rumpvfs/devnull.c diff -u src/sys/rump/librump/rumpvfs/devnull.c:1.3 src/sys/rump/librump/rumpvfs/devnull.c:1.4 --- src/sys/rump/librump/rumpvfs/devnull.c:1.3 Thu Feb 10 11:01:31 2011 +++ src/sys/rump/librump/rumpvfs/devnull.c Thu Apr 4 01:29:55 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: devnull.c,v 1.3 2011/02/10 11:01:31 pooka Exp $ */ +/* $NetBSD: devnull.c,v 1.4 2013/04/04 01:29:55 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -33,7 +33,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: devnull.c,v 1.3 2011/02/10 11:01:31 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: devnull.c,v 1.4 2013/04/04 01:29:55 pooka Exp $); #include sys/param.h #include sys/conf.h @@ -60,7 +60,12 @@ rump_devnull_init() error = devsw_attach(null, NULL, null_bmaj, null_cdevsw,null_cmaj); KASSERT(error || null_cmaj == 2); - return error; + error = rump_vfs_makeonedevnode(S_IFCHR, + /dev/null, null_cmaj, DEV_NULL); + if (error) + return error; + return rump_vfs_makeonedevnode(S_IFCHR, + /dev/zero, null_cmaj, DEV_ZERO); } static int
CVS commit: src/sys/rump/dev/lib/libputter
Module Name:src Committed By: pooka Date: Thu Apr 4 01:33:53 UTC 2013 Modified Files: src/sys/rump/dev/lib/libputter: Makefile Added Files: src/sys/rump/dev/lib/libputter: component.c Log Message: create /dev/putter device node in component attach To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/rump/dev/lib/libputter/Makefile cvs rdiff -u -r0 -r1.3 src/sys/rump/dev/lib/libputter/component.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/dev/lib/libputter/Makefile diff -u src/sys/rump/dev/lib/libputter/Makefile:1.3 src/sys/rump/dev/lib/libputter/Makefile:1.4 --- src/sys/rump/dev/lib/libputter/Makefile:1.3 Thu Mar 31 08:36:25 2011 +++ src/sys/rump/dev/lib/libputter/Makefile Thu Apr 4 01:33:53 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2011/03/31 08:36:25 pooka Exp $ +# $NetBSD: Makefile,v 1.4 2013/04/04 01:33:53 pooka Exp $ # .PATH: ${.CURDIR}/../../../../dev/putter @@ -6,6 +6,7 @@ LIB= rumpdev_putter SRCS= putter.c +SRCS+= component.c .include bsd.lib.mk .include bsd.klinks.mk Added files: Index: src/sys/rump/dev/lib/libputter/component.c diff -u /dev/null src/sys/rump/dev/lib/libputter/component.c:1.3 --- /dev/null Thu Apr 4 01:33:53 2013 +++ src/sys/rump/dev/lib/libputter/component.c Thu Apr 4 01:33:53 2013 @@ -0,0 +1,46 @@ +/* $NetBSD: component.c,v 1.3 2013/04/04 01:33:53 pooka Exp $ */ + +/*- + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * 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 AUTHOR ``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 AUTHOR 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: component.c,v 1.3 2013/04/04 01:33:53 pooka Exp $); + +#include sys/param.h +#include sys/conf.h +#include sys/device.h +#include sys/stat.h + +#include rump_private.h +#include rump_vfs_private.h + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + int error; + + if ((error = rump_vfs_makeonedevnode(S_IFCHR, + /dev/putter, 178, 0)) != 0) + panic(cannot create /dev/putter: %d, error); +}
CVS commit: src/sys/rump/dev/lib/libmd
Module Name:src Committed By: pooka Date: Thu Apr 4 01:38:47 UTC 2013 Modified Files: src/sys/rump/dev/lib/libmd: component.c Log Message: create device nodes To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/rump/dev/lib/libmd/component.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/dev/lib/libmd/component.c diff -u src/sys/rump/dev/lib/libmd/component.c:1.2 src/sys/rump/dev/lib/libmd/component.c:1.3 --- src/sys/rump/dev/lib/libmd/component.c:1.2 Tue Apr 10 13:45:08 2012 +++ src/sys/rump/dev/lib/libmd/component.c Thu Apr 4 01:38:47 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: component.c,v 1.2 2012/04/10 13:45:08 gson Exp $ */ +/* $NetBSD: component.c,v 1.3 2013/04/04 01:38:47 pooka Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: component.c,v 1.2 2012/04/10 13:45:08 gson Exp $); +__KERNEL_RCSID(0, $NetBSD: component.c,v 1.3 2013/04/04 01:38:47 pooka Exp $); #include sys/param.h #include sys/conf.h @@ -57,5 +57,12 @@ RUMP_COMPONENT(RUMP_COMPONENT_DEV) md_cdevsw, cmaj)) != 0) panic(md devsw attach failed: %d, error); +if ((error = rump_vfs_makedevnodes(S_IFBLK, /dev/md0, 'a', +bmaj, 0, 7)) != 0) +panic(cannot create cooked md dev nodes: %d, error); +if ((error = rump_vfs_makedevnodes(S_IFCHR, /dev/rmd0, 'a', +cmaj, 0, 7)) != 0) +panic(cannot create raw md dev nodes: %d, error); + rump_pdev_add(mdattach, 0); }
CVS commit: src/sys/rump/dev/lib/libpad
Module Name:src Committed By: pooka Date: Thu Apr 4 01:41:51 UTC 2013 Modified Files: src/sys/rump/dev/lib/libpad: Makefile Added Files: src/sys/rump/dev/lib/libpad: component.c Log Message: create device nodes To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/rump/dev/lib/libpad/Makefile cvs rdiff -u -r0 -r1.1 src/sys/rump/dev/lib/libpad/component.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/dev/lib/libpad/Makefile diff -u src/sys/rump/dev/lib/libpad/Makefile:1.1 src/sys/rump/dev/lib/libpad/Makefile:1.2 --- src/sys/rump/dev/lib/libpad/Makefile:1.1 Sat May 1 23:21:24 2010 +++ src/sys/rump/dev/lib/libpad/Makefile Thu Apr 4 01:41:51 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2010/05/01 23:21:24 pooka Exp $ +# $NetBSD: Makefile,v 1.2 2013/04/04 01:41:51 pooka Exp $ # .PATH: ${.CURDIR}/../../../../dev/pad @@ -6,6 +6,7 @@ LIB= rumpdev_pad SRCS= pad.c padvol.c +SRCS+= component.c CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpvfs Added files: Index: src/sys/rump/dev/lib/libpad/component.c diff -u /dev/null src/sys/rump/dev/lib/libpad/component.c:1.1 --- /dev/null Thu Apr 4 01:41:51 2013 +++ src/sys/rump/dev/lib/libpad/component.c Thu Apr 4 01:41:51 2013 @@ -0,0 +1,45 @@ +/* $NetBSD: component.c,v 1.1 2013/04/04 01:41:51 pooka Exp $ */ + +/*- + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * 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 AUTHOR ``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 AUTHOR 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: component.c,v 1.1 2013/04/04 01:41:51 pooka Exp $); + +#include sys/param.h +#include sys/conf.h +#include sys/device.h +#include sys/stat.h + +#include rump_private.h +#include rump_vfs_private.h + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + int error; + + if ((error = rump_vfs_makeonedevnode(S_IFCHR, /dev/pad, 189, 0)) != 0) + panic(cannot create pad device: %d, error); +}
CVS commit: src/sys/rump/dev/lib/libputter
Module Name:src Committed By: pooka Date: Thu Apr 4 01:48:20 UTC 2013 Modified Files: src/sys/rump/dev/lib/libputter: Makefile Log Message: set correct include path To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/rump/dev/lib/libputter/Makefile 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/dev/lib/libputter/Makefile diff -u src/sys/rump/dev/lib/libputter/Makefile:1.4 src/sys/rump/dev/lib/libputter/Makefile:1.5 --- src/sys/rump/dev/lib/libputter/Makefile:1.4 Thu Apr 4 01:33:53 2013 +++ src/sys/rump/dev/lib/libputter/Makefile Thu Apr 4 01:48:19 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2013/04/04 01:33:53 pooka Exp $ +# $NetBSD: Makefile,v 1.5 2013/04/04 01:48:19 pooka Exp $ # .PATH: ${.CURDIR}/../../../../dev/putter @@ -8,5 +8,7 @@ LIB= rumpdev_putter SRCS= putter.c SRCS+= component.c +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + .include bsd.lib.mk .include bsd.klinks.mk
CVS commit: src/sys/compat/linux/arch/arm
Module Name:src Committed By: pooka Date: Thu Mar 21 15:03:47 UTC 2013 Modified Files: src/sys/compat/linux/arch/arm: linux_types.h Log Message: Fix stat64 by making it match i386. Other archs might still be broken, but this is the one I could test. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/arm/linux_types.h 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/linux/arch/arm/linux_types.h diff -u src/sys/compat/linux/arch/arm/linux_types.h:1.8 src/sys/compat/linux/arch/arm/linux_types.h:1.9 --- src/sys/compat/linux/arch/arm/linux_types.h:1.8 Sun Jan 11 02:45:48 2009 +++ src/sys/compat/linux/arch/arm/linux_types.h Thu Mar 21 15:03:47 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_types.h,v 1.8 2009/01/11 02:45:48 christos Exp $ */ +/* $NetBSD: linux_types.h,v 1.9 2013/03/21 15:03:47 pooka Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -76,34 +76,33 @@ struct linux_stat { * insane amounts of padding around dev_t's. */ struct linux_stat64 { - unsigned short lst_dev; - unsigned char __pad0[10]; + unsigned long long lst_dev; + unsigned int __pad1; #define LINUX_STAT64_HAS_BROKEN_ST_INO 1 - unsigned long __lst_ino; + unsigned int __lst_ino; unsigned int lst_mode; unsigned int lst_nlink; - unsigned long lst_uid; - unsigned long lst_gid; + unsigned int lst_uid; + unsigned int lst_gid; - unsigned short lst_rdev; - unsigned char __pad3[10]; + unsigned long long lst_rdev; + unsigned int __pad2; long long lst_size; - unsigned long lst_blksize; + unsigned int lst_blksize; - unsigned long lst_blocks; /* Number 512-byte blocks allocated. */ - unsigned long __pad4; /* future possible st_blocks high bits*/ + unsigned long long lst_blocks; /* Number 512-byte blocks allocated. */ - unsigned long lst_atime; - unsigned long __pad5; + unsigned int lst_atime; + unsigned int lst_atime_nsec; - unsigned long lst_mtime; - unsigned long __pad6; + unsigned int lst_mtime; + unsigned int lst_mtime_nsec; - unsigned long lst_ctime; - unsigned long __pad7; /* will be high 32 bits of ctime someday */ + unsigned int lst_ctime; + unsigned int lst_ctime_nsec; unsigned long long lst_ino; };
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Wed Mar 20 12:30:13 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_dl.c rumpuser_port.h Log Message: Use _FILE_OFFSET_BITS=64 on Solaris too (necessary for 32bit builds). To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/librumpuser/rumpuser_dl.c cvs rdiff -u -r1.14 -r1.15 src/lib/librumpuser/rumpuser_port.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_dl.c diff -u src/lib/librumpuser/rumpuser_dl.c:1.15 src/lib/librumpuser/rumpuser_dl.c:1.16 --- src/lib/librumpuser/rumpuser_dl.c:1.15 Tue Mar 12 14:03:32 2013 +++ src/lib/librumpuser/rumpuser_dl.c Wed Mar 20 12:30:13 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_dl.c,v 1.15 2013/03/12 14:03:32 pooka Exp $ */ +/* $NetBSD: rumpuser_dl.c,v 1.16 2013/03/20 12:30:13 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -30,10 +30,18 @@ * Called during rump bootstrap. */ +/* + * Solaris libelf.h doesn't support _FILE_OFFSET_BITS=64. Luckily, + * for this module it doesn't matter. + */ +#if defined(__sun__) defined(_IPL32) +#define _FILE_OFFSET_BITS 32 +#endif + #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_dl.c,v 1.15 2013/03/12 14:03:32 pooka Exp $); +__RCSID($NetBSD: rumpuser_dl.c,v 1.16 2013/03/20 12:30:13 pooka Exp $); #endif /* !lint */ #include sys/types.h Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.14 src/lib/librumpuser/rumpuser_port.h:1.15 --- src/lib/librumpuser/rumpuser_port.h:1.14 Thu Mar 14 21:31:35 2013 +++ src/lib/librumpuser/rumpuser_port.h Wed Mar 20 12:30:13 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_port.h,v 1.14 2013/03/14 21:31:35 pooka Exp $ */ +/* $NetBSD: rumpuser_port.h,v 1.15 2013/03/20 12:30:13 pooka Exp $ */ /* * Portability header for non-NetBSD platforms. @@ -46,6 +46,10 @@ #include features.h #endif +#if defined(__sun__) !defined(_FILE_OFFSET_BITS) +#define _FILE_OFFSET_BITS 64 +#endif + #include sys/types.h #include sys/param.h
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Wed Mar 20 12:59:10 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_dl.c rumpuser_port.h Log Message: Attempt two for the previous: _ILP32 comes from headers, so don't use it to decide if we want to muddle with _FILE_OFFSET_BITS. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/lib/librumpuser/rumpuser_dl.c cvs rdiff -u -r1.15 -r1.16 src/lib/librumpuser/rumpuser_port.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_dl.c diff -u src/lib/librumpuser/rumpuser_dl.c:1.16 src/lib/librumpuser/rumpuser_dl.c:1.17 --- src/lib/librumpuser/rumpuser_dl.c:1.16 Wed Mar 20 12:30:13 2013 +++ src/lib/librumpuser/rumpuser_dl.c Wed Mar 20 12:59:10 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_dl.c,v 1.16 2013/03/20 12:30:13 pooka Exp $ */ +/* $NetBSD: rumpuser_dl.c,v 1.17 2013/03/20 12:59:10 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -34,14 +34,13 @@ * Solaris libelf.h doesn't support _FILE_OFFSET_BITS=64. Luckily, * for this module it doesn't matter. */ -#if defined(__sun__) defined(_IPL32) -#define _FILE_OFFSET_BITS 32 +#if defined(__sun__) +#define RUMPUSER_NO_FILE_OFFSET_BITS #endif - #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_dl.c,v 1.16 2013/03/20 12:30:13 pooka Exp $); +__RCSID($NetBSD: rumpuser_dl.c,v 1.17 2013/03/20 12:59:10 pooka Exp $); #endif /* !lint */ #include sys/types.h Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.15 src/lib/librumpuser/rumpuser_port.h:1.16 --- src/lib/librumpuser/rumpuser_port.h:1.15 Wed Mar 20 12:30:13 2013 +++ src/lib/librumpuser/rumpuser_port.h Wed Mar 20 12:59:10 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_port.h,v 1.15 2013/03/20 12:30:13 pooka Exp $ */ +/* $NetBSD: rumpuser_port.h,v 1.16 2013/03/20 12:59:10 pooka Exp $ */ /* * Portability header for non-NetBSD platforms. @@ -46,8 +46,12 @@ #include features.h #endif -#if defined(__sun__) !defined(_FILE_OFFSET_BITS) -#define _FILE_OFFSET_BITS 64 +#if defined(__sun__) +# if defined(RUMPUSER_NO_FILE_OFFSET_BITS) +#undef _FILE_OFFSET_BITS +# else +#define _FILE_OFFSET_BITS 64 +# endif #endif #include sys/types.h
CVS commit: src
Module Name:src Committed By: pooka Date: Mon Mar 18 13:14:11 UTC 2013 Modified Files: src/lib/librumpuser: Makefile src/sys/rump/net/lib/libsockin: Makefile sockin.c Added Files: src/sys/rump/net/lib/libsockin: rumpcomp_user.c rumpcomp_user.h Removed Files: src/lib/librumpuser: rumpuser_net.c Log Message: Move the rumpuser_net set of hypercalls to be a private to the sockin component. This cleans up the generic hypercall interfaces from ones specific to only one component. They should always have been private, but the infrastructure to make it so didn't exist earlier. no functional change To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/lib/librumpuser/Makefile cvs rdiff -u -r1.3 -r0 src/lib/librumpuser/rumpuser_net.c cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libsockin/Makefile cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libsockin/rumpcomp_user.c \ src/sys/rump/net/lib/libsockin/rumpcomp_user.h cvs rdiff -u -r1.26 -r1.27 src/sys/rump/net/lib/libsockin/sockin.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/Makefile diff -u src/lib/librumpuser/Makefile:1.8 src/lib/librumpuser/Makefile:1.9 --- src/lib/librumpuser/Makefile:1.8 Fri Mar 1 18:15:36 2013 +++ src/lib/librumpuser/Makefile Mon Mar 18 13:14:10 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2013/03/01 18:15:36 pooka Exp $ +# $NetBSD: Makefile,v 1.9 2013/03/18 13:14:10 pooka Exp $ # WARNS?= 5 @@ -11,7 +11,7 @@ LIBDPLIBS+= pthread ${.CURDIR}/../libpth CPPFLAGS+= -DLIBRUMPUSER #CPPFLAGS+= -D_DIAGNOSTIC -SRCS= rumpuser.c rumpuser_net.c +SRCS= rumpuser.c SRCS+= rumpuser_pth.c SRCS+= rumpuser_dl.c rumpuser_sp.c rumpuser_daemonize.c SRCS+= rumpuser_component.c Index: src/sys/rump/net/lib/libsockin/Makefile diff -u src/sys/rump/net/lib/libsockin/Makefile:1.5 src/sys/rump/net/lib/libsockin/Makefile:1.6 --- src/sys/rump/net/lib/libsockin/Makefile:1.5 Sat Dec 12 17:10:20 2009 +++ src/sys/rump/net/lib/libsockin/Makefile Mon Mar 18 13:14:11 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2009/12/12 17:10:20 pooka Exp $ +# $NetBSD: Makefile,v 1.6 2013/03/18 13:14:11 pooka Exp $ # LIB= rumpnet_sockin @@ -8,5 +8,7 @@ SRCS+= component.c CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern +RUMPCOMP_USER= #defined + .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/net/lib/libsockin/sockin.c diff -u src/sys/rump/net/lib/libsockin/sockin.c:1.26 src/sys/rump/net/lib/libsockin/sockin.c:1.27 --- src/sys/rump/net/lib/libsockin/sockin.c:1.26 Thu Mar 31 19:40:54 2011 +++ src/sys/rump/net/lib/libsockin/sockin.c Mon Mar 18 13:14:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sockin.c,v 1.26 2011/03/31 19:40:54 dyoung Exp $ */ +/* $NetBSD: sockin.c,v 1.27 2013/03/18 13:14:11 pooka Exp $ */ /* * Copyright (c) 2008, 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: sockin.c,v 1.26 2011/03/31 19:40:54 dyoung Exp $); +__KERNEL_RCSID(0, $NetBSD: sockin.c,v 1.27 2013/03/18 13:14:11 pooka Exp $); #include sys/param.h #include sys/condvar.h @@ -53,6 +53,7 @@ __KERNEL_RCSID(0, $NetBSD: sockin.c,v 1 #include rump/rumpuser.h #include rump_private.h +#include rumpcomp_user.h /* * An inet communication domain which uses the socket interface. @@ -198,7 +199,7 @@ sockin_process(struct socket *so) rmsg.msg_name = (struct sockaddr *)from; rmsg.msg_namelen = sizeof(from); - n = rumpuser_net_recvmsg(SO2S(so), rmsg, 0, error); + n = rumpcomp_sockin_recvmsg(SO2S(so), rmsg, 0, error); if (n = 0) { m_freem(m); @@ -236,7 +237,7 @@ sockin_accept(struct socket *so) int news, error, slen; slen = sizeof(sin); - news = rumpuser_net_accept(SO2S(so), (struct sockaddr *)sin, + news = rumpcomp_sockin_accept(SO2S(so), (struct sockaddr *)sin, slen, error); if (news == -1) return; @@ -371,7 +372,7 @@ sockin_usrreq(struct socket *so, int req break; } - news = rumpuser_net_socket(PF_INET, so-so_proto-pr_type, + news = rumpcomp_sockin_socket(PF_INET, so-so_proto-pr_type, 0, error); if (news == -1) break; @@ -379,10 +380,12 @@ sockin_usrreq(struct socket *so, int req /* for UDP sockets, make sure we can sendrecv max */ if (so-so_proto-pr_type == SOCK_DGRAM) { sbsize = SOCKIN_SBSIZE; - rumpuser_net_setsockopt(news, SOL_SOCKET, SO_SNDBUF, + rumpcomp_sockin_setsockopt(news, + SOL_SOCKET, SO_SNDBUF, sbsize, sizeof(sbsize), error); sbsize = SOCKIN_SBSIZE; - rumpuser_net_setsockopt(news, SOL_SOCKET, SO_RCVBUF, + rumpcomp_sockin_setsockopt(news, + SOL_SOCKET, SO_RCVBUF, sbsize, sizeof(sbsize), error); } @@ -397,12 +400,13 @@ sockin_usrreq(struct socket *so, int req break; case PRU_BIND: - rumpuser_net_bind(SO2S(so), mtod(nam, const struct sockaddr *), + rumpcomp_sockin_bind(SO2S(so), + mtod(nam, const struct
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Mon Mar 18 15:55:43 UTC 2013 Modified Files: src/sys/rump: VERSION listsrcdirs Log Message: add librumphijack to the list To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/rump/VERSION cvs rdiff -u -r1.3 -r1.4 src/sys/rump/listsrcdirs 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/VERSION diff -u src/sys/rump/VERSION:1.6 src/sys/rump/VERSION:1.7 --- src/sys/rump/VERSION:1.6 Thu Mar 7 21:12:25 2013 +++ src/sys/rump/VERSION Mon Mar 18 15:55:43 2013 @@ -1,4 +1,4 @@ -# $NetBSD: VERSION,v 1.6 2013/03/07 21:12:25 pooka Exp $ +# $NetBSD: VERSION,v 1.7 2013/03/18 15:55:43 pooka Exp $ # # Since cvs does not provide a version number for the entire tree, provide # identifiers which can be used by external parties to check if the NetBSD @@ -9,4 +9,4 @@ # when date is bumped. # -BUILDRUMP=20130307:0 +BUILDRUMP=20130318:0 Index: src/sys/rump/listsrcdirs diff -u src/sys/rump/listsrcdirs:1.3 src/sys/rump/listsrcdirs:1.4 --- src/sys/rump/listsrcdirs:1.3 Sun Mar 10 14:15:54 2013 +++ src/sys/rump/listsrcdirs Mon Mar 18 15:55:43 2013 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: listsrcdirs,v 1.3 2013/03/10 14:15:54 pooka Exp $ +# $NetBSD: listsrcdirs,v 1.4 2013/03/18 15:55:43 pooka Exp $ # # @@ -23,7 +23,7 @@ precho src/ build.sh Makefile Makefile precho src/ tools common include share/mk precho src/etc/ Makefile.params master.passwd group precho src/lib/lib c util rump -precho src/lib/librump user client dev net vfs +precho src/lib/librump user client hijack dev net vfs precho src/external/bsd/ flex mdocml byacc precho src/external/cddl/ osnet precho src/external/historical/ nawk
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Mon Mar 18 21:00:52 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser.c Log Message: Terminate result of readlink(). Makes writefilewatch_setup() work in cases when the buffer doesn't accidentally contain suitable zeroes. Thanks to Juan RP who debugged this with me! To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/lib/librumpuser/rumpuser.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser.c diff -u src/lib/librumpuser/rumpuser.c:1.28 src/lib/librumpuser/rumpuser.c:1.29 --- src/lib/librumpuser/rumpuser.c:1.28 Mon Jan 14 21:04:15 2013 +++ src/lib/librumpuser/rumpuser.c Mon Mar 18 21:00:52 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.c,v 1.28 2013/01/14 21:04:15 pooka Exp $ */ +/* $NetBSD: rumpuser.c,v 1.29 2013/03/18 21:00:52 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser.c,v 1.28 2013/01/14 21:04:15 pooka Exp $); +__RCSID($NetBSD: rumpuser.c,v 1.29 2013/03/18 21:00:52 pooka Exp $); #endif /* !lint */ #include sys/ioctl.h @@ -660,8 +660,8 @@ rumpuser_writewatchfile_setup(int inotif /* ok, need to map fd into path for inotify */ snprintf(procbuf, sizeof(procbuf), /proc/self/fd/%d, fd); - nn = readlink(procbuf, linkbuf, sizeof(linkbuf)); - if (nn = (ssize_t)sizeof(linkbuf)) { + nn = readlink(procbuf, linkbuf, sizeof(linkbuf)-1); + if (nn = (ssize_t)sizeof(linkbuf)-1) { nn = -1; errno = E2BIG; /* pick something */ } @@ -671,6 +671,7 @@ rumpuser_writewatchfile_setup(int inotif return -1; } + linkbuf[nn] = '\0'; if (inotify_add_watch(inotify, linkbuf, IN_MODIFY) == -1) { seterror(errno); close(inotify);
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 15 11:15:23 UTC 2013 Modified Files: src/sys/rump: Makefile.rump Log Message: Use -isysroot ${DESTDIR} for RUMPCOMP_USER when run as part of build.sh so as to catch the necessary headers, which, unlike in the buildrump.sh case, are not supposed to be intermingled with the ones provided by the host. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/rump/Makefile.rump 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/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.70 src/sys/rump/Makefile.rump:1.71 --- src/sys/rump/Makefile.rump:1.70 Fri Mar 1 18:11:11 2013 +++ src/sys/rump/Makefile.rump Fri Mar 15 11:15:22 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.70 2013/03/01 18:11:11 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.71 2013/03/15 11:15:22 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -79,19 +79,19 @@ DPSRCS+= ${RUMPTOP}/Makefile.rump .ifdef RUMPCOMP_USER rumpcomp_user.d: rumpcomp_user.c ${_MKTARGET_CREATE} - ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.CURDIR}/rumpcomp_user.c + ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS:U-isysroot ${DESTDIR}} ${RUMPCOMP_USER_CPPFLAGS} ${.CURDIR}/rumpcomp_user.c rumpcomp_user.o: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c + ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS:U-isysroot ${DESTDIR}} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c rumpcomp_user.pico: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c + ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS:U-isysroot ${DESTDIR}} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c rumpcomp_user.po: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c + ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS:U-isysroot ${DESTDIR}} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c RUMPCOMP_USEROBJ=rumpcomp_user.*o SRCS+=rumpcomp_user.c
CVS commit: src/sys/rump/net/lib/libvirtif
Module Name:src Committed By: pooka Date: Fri Mar 15 11:30:23 UTC 2013 Modified Files: src/sys/rump/net/lib/libvirtif: Makefile if_virt.c Log Message: Rerevert to preprevious now that this builds with build.sh To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libvirtif/Makefile cvs rdiff -u -r1.29 -r1.30 src/sys/rump/net/lib/libvirtif/if_virt.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/net/lib/libvirtif/Makefile diff -u src/sys/rump/net/lib/libvirtif/Makefile:1.5 src/sys/rump/net/lib/libvirtif/Makefile:1.6 --- src/sys/rump/net/lib/libvirtif/Makefile:1.5 Thu Mar 14 01:23:34 2013 +++ src/sys/rump/net/lib/libvirtif/Makefile Fri Mar 15 11:30:23 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2013/03/14 01:23:34 pooka Exp $ +# $NetBSD: Makefile,v 1.6 2013/03/15 11:30:23 pooka Exp $ # LIB= rumpnet_virtif @@ -6,7 +6,9 @@ LIB= rumpnet_virtif SRCS= if_virt.c SRCS+= component.c -CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpkern +CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpkern -I${.CURDIR} + +RUMPCOMP_USER= #defined .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/net/lib/libvirtif/if_virt.c diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.29 src/sys/rump/net/lib/libvirtif/if_virt.c:1.30 --- src/sys/rump/net/lib/libvirtif/if_virt.c:1.29 Thu Mar 14 01:23:34 2013 +++ src/sys/rump/net/lib/libvirtif/if_virt.c Fri Mar 15 11:30:23 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_virt.c,v 1.29 2013/03/14 01:23:34 pooka Exp $ */ +/* $NetBSD: if_virt.c,v 1.30 2013/03/15 11:30:23 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_virt.c,v 1.29 2013/03/14 01:23:34 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: if_virt.c,v 1.30 2013/03/15 11:30:23 pooka Exp $); #include sys/param.h #include sys/condvar.h @@ -49,11 +49,12 @@ __KERNEL_RCSID(0, $NetBSD: if_virt.c,v #include netinet/in_var.h #include rump/rump.h -#include rump/rumpuser.h #include rump_private.h #include rump_net_private.h +#include rumpcomp_user.h + /* * Virtual interface for userspace purposes. Uses tap(4) to * interface with the kernel and just simply shovels data @@ -69,7 +70,7 @@ static void virtif_stop(struct ifnet *, struct virtif_sc { struct ethercom sc_ec; - int sc_tapfd; + struct virtif_user *sc_viu; bool sc_dying; struct lwp *sc_l_snd, *sc_l_rcv; kmutex_t sc_mtx; @@ -88,27 +89,23 @@ int rump_virtif_create(int num) { struct virtif_sc *sc; + struct virtif_user *viu; struct ifnet *ifp; uint8_t enaddr[ETHER_ADDR_LEN] = { 0xb2, 0x0a, 0x00, 0x0b, 0x0e, 0x01 }; - char tapdev[16]; - int fd, error = 0; + int error = 0; if (num = 0x100) return E2BIG; - snprintf(tapdev, sizeof(tapdev), /dev/tap%d, num); - fd = rumpuser_open(tapdev, RUMPUSER_OPEN_RDWR, error); - if (fd == -1) { - printf(virtif_create: can't open /dev/tap%d: %d\n, - num, error); - return error; - } + if ((viu = rumpcomp_virtif_create(num)) == NULL) + return ENXIO; + enaddr[2] = cprng_fast32() 0xff; enaddr[5] = num; sc = kmem_zalloc(sizeof(*sc), KM_SLEEP); sc-sc_dying = false; - sc-sc_tapfd = fd; + sc-sc_viu = viu; mutex_init(sc-sc_mtx, MUTEX_DEFAULT, IPL_NONE); cv_init(sc-sc_cv, virtsnd); @@ -168,6 +165,8 @@ virtif_unclone(struct ifnet *ifp) cv_broadcast(sc-sc_cv); mutex_exit(sc-sc_mtx); + rumpcomp_virtif_dying(sc-sc_viu); + virtif_stop(ifp, 1); if_down(ifp); @@ -180,7 +179,7 @@ virtif_unclone(struct ifnet *ifp) sc-sc_l_rcv = NULL; } - rumpuser_close(sc-sc_tapfd, NULL); + rumpcomp_virtif_destroy(sc-sc_viu); mutex_destroy(sc-sc_mtx); cv_destroy(sc-sc_cv); @@ -220,7 +219,6 @@ virtif_ioctl(struct ifnet *ifp, u_long c return rv; } -/* just send everything in-context */ static void virtif_start(struct ifnet *ifp) { @@ -252,35 +250,21 @@ virtif_receiver(void *arg) struct virtif_sc *sc = ifp-if_softc; struct mbuf *m; size_t plen = ETHER_MAX_LEN_JUMBO+1; - struct pollfd pfd; ssize_t n; - int error, rv; - - pfd.fd = sc-sc_tapfd; - pfd.events = POLLIN; for (;;) { m = m_gethdr(M_WAIT, MT_DATA); MEXTMALLOC(m, plen, M_WAIT); again: - /* poll, but periodically check if we should die */ - rv = rumpuser_poll(pfd, 1, POLLTIMO_MS, error); if (sc-sc_dying) { m_freem(m); break; } - if (rv == 0) - goto again; - - n = rumpuser_read(sc-sc_tapfd, mtod(m, void *), plen, error); - KASSERT(n ETHER_MAX_LEN_JUMBO); - if (__predict_false(n 0)) { - if (n == -1 error == EAGAIN) { -goto again; - } - - printf(%s: read from /dev/tap failed. host is down?\n, + + n = rumpcomp_virtif_recv(sc-sc_viu, mtod(m, void *), plen); + if (n 0) { + printf(%s: read hypercall failed. host if down?\n, ifp-if_xname); mutex_enter(sc-sc_mtx); /* could check if need go, done soon anyway
CVS commit: src/sys/rump/librump
Module Name:src Committed By: pooka Date: Fri Mar 15 12:09:59 UTC 2013 Modified Files: src/sys/rump/librump/rumpdev: Makefile.rumpdev src/sys/rump/librump/rumpkern: Makefile.rumpkern src/sys/rump/librump/rumpnet: Makefile.rumpnet src/sys/rump/librump/rumpvfs: Makefile.rumpvfs Log Message: Allow Makefile.rump to append to SRCS. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/rump/librump/rumpdev/Makefile.rumpdev cvs rdiff -u -r1.123 -r1.124 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.12 -r1.13 src/sys/rump/librump/rumpnet/Makefile.rumpnet cvs rdiff -u -r1.35 -r1.36 src/sys/rump/librump/rumpvfs/Makefile.rumpvfs 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/rumpdev/Makefile.rumpdev diff -u src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.5 src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.6 --- src/sys/rump/librump/rumpdev/Makefile.rumpdev:1.5 Tue Feb 16 20:42:47 2010 +++ src/sys/rump/librump/rumpdev/Makefile.rumpdev Fri Mar 15 12:09:58 2013 @@ -1,8 +1,6 @@ -# $NetBSD: Makefile.rumpdev,v 1.5 2010/02/16 20:42:47 pooka Exp $ +# $NetBSD: Makefile.rumpdev,v 1.6 2013/03/15 12:09:58 pooka Exp $ # -.include ${RUMPTOP}/Makefile.rump - LIB= rumpdev .PATH: ${RUMPTOP}/librump/rumpdev\ @@ -19,5 +17,7 @@ SHLIB_MINOR=0 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpdev/opt +.include ${RUMPTOP}/Makefile.rump + .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.123 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.124 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.123 Sun Mar 10 17:05:12 2013 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Fri Mar 15 12:09:58 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.123 2013/03/10 17:05:12 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.124 2013/03/15 12:09:58 pooka Exp $ # .include ${RUMPTOP}/Makefile.rump @@ -19,7 +19,7 @@ LIB= rump # # Source modules, first the ones specifically implemented for librump. # -SRCS= rump.c rumpcopy.c emul.c intr.c lwproc.c klock.c \ +SRCS+= rump.c rumpcopy.c emul.c intr.c lwproc.c klock.c \ kobj_rename.c ltsleep.c scheduler.c \ signals.c sleepq.c threads.c vm.c cprng_stub.c Index: src/sys/rump/librump/rumpnet/Makefile.rumpnet diff -u src/sys/rump/librump/rumpnet/Makefile.rumpnet:1.12 src/sys/rump/librump/rumpnet/Makefile.rumpnet:1.13 --- src/sys/rump/librump/rumpnet/Makefile.rumpnet:1.12 Thu Mar 31 19:40:53 2011 +++ src/sys/rump/librump/rumpnet/Makefile.rumpnet Fri Mar 15 12:09:59 2013 @@ -1,8 +1,6 @@ -# $NetBSD: Makefile.rumpnet,v 1.12 2011/03/31 19:40:53 dyoung Exp $ +# $NetBSD: Makefile.rumpnet,v 1.13 2013/03/15 12:09:59 pooka Exp $ # -.include ${RUMPTOP}/Makefile.rump - LIB= rumpnet .PATH: ${RUMPTOP}/librump/rumpnet\ @@ -34,5 +32,7 @@ SHLIB_MINOR=0 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpnet/opt +.include ${RUMPTOP}/Makefile.rump + .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/librump/rumpvfs/Makefile.rumpvfs diff -u src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.35 src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.36 --- src/sys/rump/librump/rumpvfs/Makefile.rumpvfs:1.35 Sun May 13 09:42:36 2012 +++ src/sys/rump/librump/rumpvfs/Makefile.rumpvfs Fri Mar 15 12:09:59 2013 @@ -1,8 +1,6 @@ -# $NetBSD: Makefile.rumpvfs,v 1.35 2012/05/13 09:42:36 dholland Exp $ +# $NetBSD: Makefile.rumpvfs,v 1.36 2013/03/15 12:09:59 pooka Exp $ # -.include ${RUMPTOP}/Makefile.rump - LIB= rumpvfs .PATH: ${RUMPTOP}/librump/rumpvfs ${RUMPTOP}/librump \ @@ -69,5 +67,7 @@ SHLIB_MINOR=0 CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern +.include ${RUMPTOP}/Makefile.rump + .include bsd.lib.mk .include bsd.klinks.mk
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 15 12:12:16 UTC 2013 Added Files: src/sys/rump: sunldgen.sh Log Message: Support generating support for Sun ld. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/rump/sunldgen.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/rump/sunldgen.sh diff -u /dev/null src/sys/rump/sunldgen.sh:1.1 --- /dev/null Fri Mar 15 12:12:16 2013 +++ src/sys/rump/sunldgen.sh Fri Mar 15 12:12:16 2013 @@ -0,0 +1,38 @@ +#!/bin/sh +# +# $NetBSD: sunldgen.sh,v 1.1 2013/03/15 12:12:16 pooka Exp $ +# + +# To support the Sun linker we need to make it behave like the GNU linker +# for orphaned sections. That means generating __start/__stop symbols +# for them and that means some nopoly-atheist-withoutfood level trickery. +# We enumerate all the section names we wish to generate symbols for. +# The good news is that it's unlikely for NetBSD to grow any more +# link sets, and even if it does, it'll be a build-time failure +# on Sun platforms so it's easy to catch and mend the list below. + +LINKSETS='rump_components evcnts prop_linkpools modules sysctl_funcs + bufq_strats domains dkwedge_methods ieee80211_funcs' + +exec 1 ldscript_sun.rump +printf '# $NetBSD: sunldgen.sh,v 1.1 2013/03/15 12:12:16 pooka Exp $\n\n$mapfile_version 2\nLOAD_SEGMENT rumpkern_linksets {' +for lset in ${LINKSETS}; do + printf '\n\tASSIGN_SECTION { IS_NAME= link_set_start_%s };\n' $lset + printf '\tASSIGN_SECTION { IS_NAME= link_set_%s };\n' $lset + printf '\tASSIGN_SECTION { IS_NAME= link_set_stop_%s };\n' $lset + printf '\tOS_ORDER+= link_set_start_%s\n' $lset + printf '\tlink_set_%s\n' $lset + printf '\tlink_set_stop_%s;\n' $lset +done +echo '};' + +exec 1 linksyms_sun.c +printf '/* $NetBSD: sunldgen.sh,v 1.1 2013/03/15 12:12:16 pooka Exp $ */\n\n' +for lset in ${LINKSETS}; do + printf 'int __start_link_set_%s[0]\n' $lset + printf '\t__attribute__((__section__(link_set_start_%s)));\n' $lset + printf 'int __link_set_dummy_%s[0]\n' $lset + printf '\t__attribute__((__section__(link_set_%s)));\n' $lset + printf 'int __stop_link_set_%s[0]\n' $lset + printf '\t__attribute__((__section__(link_set_stop_%s)));\n\n' $lset +done
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 15 12:13:07 UTC 2013 Added Files: src/sys/rump: ldscript_sun.rump linksyms_sun.c Log Message: Generate support for sun ld. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/rump/ldscript_sun.rump \ src/sys/rump/linksyms_sun.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/rump/ldscript_sun.rump diff -u /dev/null src/sys/rump/ldscript_sun.rump:1.1 --- /dev/null Fri Mar 15 12:13:07 2013 +++ src/sys/rump/ldscript_sun.rump Fri Mar 15 12:13:07 2013 @@ -0,0 +1,67 @@ +# $NetBSD: ldscript_sun.rump,v 1.1 2013/03/15 12:13:07 pooka Exp $ + +$mapfile_version 2 +LOAD_SEGMENT rumpkern_linksets { + ASSIGN_SECTION { IS_NAME= link_set_start_rump_components }; + ASSIGN_SECTION { IS_NAME= link_set_rump_components }; + ASSIGN_SECTION { IS_NAME= link_set_stop_rump_components }; + OS_ORDER+= link_set_start_rump_components + link_set_rump_components + link_set_stop_rump_components; + + ASSIGN_SECTION { IS_NAME= link_set_start_evcnts }; + ASSIGN_SECTION { IS_NAME= link_set_evcnts }; + ASSIGN_SECTION { IS_NAME= link_set_stop_evcnts }; + OS_ORDER+= link_set_start_evcnts + link_set_evcnts + link_set_stop_evcnts; + + ASSIGN_SECTION { IS_NAME= link_set_start_prop_linkpools }; + ASSIGN_SECTION { IS_NAME= link_set_prop_linkpools }; + ASSIGN_SECTION { IS_NAME= link_set_stop_prop_linkpools }; + OS_ORDER+= link_set_start_prop_linkpools + link_set_prop_linkpools + link_set_stop_prop_linkpools; + + ASSIGN_SECTION { IS_NAME= link_set_start_modules }; + ASSIGN_SECTION { IS_NAME= link_set_modules }; + ASSIGN_SECTION { IS_NAME= link_set_stop_modules }; + OS_ORDER+= link_set_start_modules + link_set_modules + link_set_stop_modules; + + ASSIGN_SECTION { IS_NAME= link_set_start_sysctl_funcs }; + ASSIGN_SECTION { IS_NAME= link_set_sysctl_funcs }; + ASSIGN_SECTION { IS_NAME= link_set_stop_sysctl_funcs }; + OS_ORDER+= link_set_start_sysctl_funcs + link_set_sysctl_funcs + link_set_stop_sysctl_funcs; + + ASSIGN_SECTION { IS_NAME= link_set_start_bufq_strats }; + ASSIGN_SECTION { IS_NAME= link_set_bufq_strats }; + ASSIGN_SECTION { IS_NAME= link_set_stop_bufq_strats }; + OS_ORDER+= link_set_start_bufq_strats + link_set_bufq_strats + link_set_stop_bufq_strats; + + ASSIGN_SECTION { IS_NAME= link_set_start_domains }; + ASSIGN_SECTION { IS_NAME= link_set_domains }; + ASSIGN_SECTION { IS_NAME= link_set_stop_domains }; + OS_ORDER+= link_set_start_domains + link_set_domains + link_set_stop_domains; + + ASSIGN_SECTION { IS_NAME= link_set_start_dkwedge_methods }; + ASSIGN_SECTION { IS_NAME= link_set_dkwedge_methods }; + ASSIGN_SECTION { IS_NAME= link_set_stop_dkwedge_methods }; + OS_ORDER+= link_set_start_dkwedge_methods + link_set_dkwedge_methods + link_set_stop_dkwedge_methods; + + ASSIGN_SECTION { IS_NAME= link_set_start_ieee80211_funcs }; + ASSIGN_SECTION { IS_NAME= link_set_ieee80211_funcs }; + ASSIGN_SECTION { IS_NAME= link_set_stop_ieee80211_funcs }; + OS_ORDER+= link_set_start_ieee80211_funcs + link_set_ieee80211_funcs + link_set_stop_ieee80211_funcs; +}; Index: src/sys/rump/linksyms_sun.c diff -u /dev/null src/sys/rump/linksyms_sun.c:1.1 --- /dev/null Fri Mar 15 12:13:07 2013 +++ src/sys/rump/linksyms_sun.c Fri Mar 15 12:13:07 2013 @@ -0,0 +1,65 @@ +/* $NetBSD: linksyms_sun.c,v 1.1 2013/03/15 12:13:07 pooka Exp $ */ + +int __start_link_set_rump_components[0] + __attribute__((__section__(link_set_start_rump_components))); +int __link_set_dummy_rump_components[0] + __attribute__((__section__(link_set_rump_components))); +int __stop_link_set_rump_components[0] + __attribute__((__section__(link_set_stop_rump_components))); + +int __start_link_set_evcnts[0] + __attribute__((__section__(link_set_start_evcnts))); +int __link_set_dummy_evcnts[0] + __attribute__((__section__(link_set_evcnts))); +int __stop_link_set_evcnts[0] + __attribute__((__section__(link_set_stop_evcnts))); + +int __start_link_set_prop_linkpools[0] + __attribute__((__section__(link_set_start_prop_linkpools))); +int __link_set_dummy_prop_linkpools[0] + __attribute__((__section__(link_set_prop_linkpools))); +int __stop_link_set_prop_linkpools[0] + __attribute__((__section__(link_set_stop_prop_linkpools))); + +int __start_link_set_modules[0] + __attribute__((__section__(link_set_start_modules))); +int __link_set_dummy_modules[0] + __attribute__((__section__(link_set_modules))); +int __stop_link_set_modules[0] + __attribute__((__section__(link_set_stop_modules))); + +int __start_link_set_sysctl_funcs[0] + __attribute__((__section__(link_set_start_sysctl_funcs))); +int __link_set_dummy_sysctl_funcs[0] + __attribute__((__section__(link_set_sysctl_funcs))); +int __stop_link_set_sysctl_funcs[0] + __attribute__((__section__(link_set_stop_sysctl_funcs))); + +int __start_link_set_bufq_strats[0] +
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 15 12:15:52 UTC 2013 Modified Files: src/sys/rump: Makefile.rump Log Message: Use correct ldscript etc. for Sun ld. To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/rump/Makefile.rump 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/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.71 src/sys/rump/Makefile.rump:1.72 --- src/sys/rump/Makefile.rump:1.71 Fri Mar 15 11:15:22 2013 +++ src/sys/rump/Makefile.rump Fri Mar 15 12:15:52 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.71 2013/03/15 11:15:22 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.72 2013/03/15 12:15:52 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -37,7 +37,14 @@ CPPFLAGS+= -I${RUMPTOP}/../arch CPPFLAGS+= -I${RUMPTOP}/.. .endif +# my ld or yours? +.ifdef HAVE_SUN_LD +LDFLAGS+= -Wl,-M ${RUMPTOP}/ldscript_sun.rump +SRCS+= linksyms_sun.c +PATH: ${RUMPTOP} +.else LDFLAGS+= -Wl,-T ${RUMPTOP}/ldscript.rump +.fi RUMP_DIAGNOSTIC?=yes .if ${RUMP_DIAGNOSTIC} == yes
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 15 12:18:41 UTC 2013 Modified Files: src/sys/rump: Makefile.rump Log Message: On second thought, let's use make syntax in makefiles ... To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/rump/Makefile.rump 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/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.72 src/sys/rump/Makefile.rump:1.73 --- src/sys/rump/Makefile.rump:1.72 Fri Mar 15 12:15:52 2013 +++ src/sys/rump/Makefile.rump Fri Mar 15 12:18:41 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.72 2013/03/15 12:15:52 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.73 2013/03/15 12:18:41 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -44,7 +44,7 @@ SRCS+= linksyms_sun.c PATH: ${RUMPTOP} .else LDFLAGS+= -Wl,-T ${RUMPTOP}/ldscript.rump -.fi +.endif RUMP_DIAGNOSTIC?=yes .if ${RUMP_DIAGNOSTIC} == yes
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 15 12:42:18 UTC 2013 Modified Files: src/sys/rump: Makefile.rump Log Message: one more typofix To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sys/rump/Makefile.rump 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/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.73 src/sys/rump/Makefile.rump:1.74 --- src/sys/rump/Makefile.rump:1.73 Fri Mar 15 12:18:41 2013 +++ src/sys/rump/Makefile.rump Fri Mar 15 12:42:18 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.73 2013/03/15 12:18:41 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.74 2013/03/15 12:42:18 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -41,7 +41,7 @@ CPPFLAGS+= -I${RUMPTOP}/.. .ifdef HAVE_SUN_LD LDFLAGS+= -Wl,-M ${RUMPTOP}/ldscript_sun.rump SRCS+= linksyms_sun.c -PATH: ${RUMPTOP} +.PATH: ${RUMPTOP} .else LDFLAGS+= -Wl,-T ${RUMPTOP}/ldscript.rump .endif
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Thu Mar 14 20:42:57 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_port.h Log Message: StunOS = 5.11 has posix_memalign(), so add an additional constraint for when we need to emulate it with memalign() and when not. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/librumpuser/rumpuser_port.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.12 src/lib/librumpuser/rumpuser_port.h:1.13 --- src/lib/librumpuser/rumpuser_port.h:1.12 Thu Jan 17 21:42:22 2013 +++ src/lib/librumpuser/rumpuser_port.h Thu Mar 14 20:42:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_port.h,v 1.12 2013/01/17 21:42:22 pooka Exp $ */ +/* $NetBSD: rumpuser_port.h,v 1.13 2013/03/14 20:42:57 pooka Exp $ */ /* * Portability header for non-NetBSD platforms. @@ -76,7 +76,7 @@ getenv_r(const char *name, char *buf, si } #endif -#if defined(__sun__) +#if defined(__sun__) !defined(HAVE_POSIX_MEMALIGN) #include sys/sysmacros.h /* Solarisa 10 has memalign() but no posix_memalign() */
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Thu Mar 14 21:31:36 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_port.h Log Message: Refine previous: sys/sysmacros.h is where MIN/MAX comes from on Solaris, so it needs to be included unconditionally. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/librumpuser/rumpuser_port.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_port.h diff -u src/lib/librumpuser/rumpuser_port.h:1.13 src/lib/librumpuser/rumpuser_port.h:1.14 --- src/lib/librumpuser/rumpuser_port.h:1.13 Thu Mar 14 20:42:57 2013 +++ src/lib/librumpuser/rumpuser_port.h Thu Mar 14 21:31:35 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_port.h,v 1.13 2013/03/14 20:42:57 pooka Exp $ */ +/* $NetBSD: rumpuser_port.h,v 1.14 2013/03/14 21:31:35 pooka Exp $ */ /* * Portability header for non-NetBSD platforms. @@ -76,9 +76,10 @@ getenv_r(const char *name, char *buf, si } #endif -#if defined(__sun__) !defined(HAVE_POSIX_MEMALIGN) +#if defined(__sun__) #include sys/sysmacros.h +#if !defined(HAVE_POSIX_MEMALIGN) /* Solarisa 10 has memalign() but no posix_memalign() */ #include stdlib.h @@ -91,6 +92,7 @@ posix_memalign(void **ptr, size_t align, return ENOMEM; return 0; } +#endif /* !HAVE_POSIX_MEMALIGN */ #endif /* __sun__ */ #ifndef __RCSID
CVS commit: src/sys/rump/net/lib/libvirtif
Module Name:src Committed By: pooka Date: Wed Mar 13 21:13:45 UTC 2013 Modified Files: src/sys/rump/net/lib/libvirtif: Makefile if_virt.c Added Files: src/sys/rump/net/lib/libvirtif: rumpcomp_user.c rumpcomp_user.h Log Message: Push the bits accessing the networking backend into hypercalls. This allows a few highly desirable things to happen: 1) Linux support, which is included in this commit (thanks to wanq for sending me the magic bits for accessing /dev/net/tun) 2) Reusing the kernel-side of the interface for devices such as hardware packet processors which interact directly with user vm spaces (not included in the commit). To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libvirtif/Makefile cvs rdiff -u -r1.27 -r1.28 src/sys/rump/net/lib/libvirtif/if_virt.c cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c \ src/sys/rump/net/lib/libvirtif/rumpcomp_user.h 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/net/lib/libvirtif/Makefile diff -u src/sys/rump/net/lib/libvirtif/Makefile:1.3 src/sys/rump/net/lib/libvirtif/Makefile:1.4 --- src/sys/rump/net/lib/libvirtif/Makefile:1.3 Thu May 28 00:02:17 2009 +++ src/sys/rump/net/lib/libvirtif/Makefile Wed Mar 13 21:13:45 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2009/05/28 00:02:17 pooka Exp $ +# $NetBSD: Makefile,v 1.4 2013/03/13 21:13:45 pooka Exp $ # LIB= rumpnet_virtif @@ -6,7 +6,9 @@ LIB= rumpnet_virtif SRCS= if_virt.c SRCS+= component.c -CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpkern +CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpkern -I${.CURDIR} + +RUMPCOMP_USER= #defined .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/net/lib/libvirtif/if_virt.c diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.27 src/sys/rump/net/lib/libvirtif/if_virt.c:1.28 --- src/sys/rump/net/lib/libvirtif/if_virt.c:1.27 Fri Sep 14 16:29:22 2012 +++ src/sys/rump/net/lib/libvirtif/if_virt.c Wed Mar 13 21:13:45 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_virt.c,v 1.27 2012/09/14 16:29:22 pooka Exp $ */ +/* $NetBSD: if_virt.c,v 1.28 2013/03/13 21:13:45 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_virt.c,v 1.27 2012/09/14 16:29:22 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: if_virt.c,v 1.28 2013/03/13 21:13:45 pooka Exp $); #include sys/param.h #include sys/condvar.h @@ -49,11 +49,12 @@ __KERNEL_RCSID(0, $NetBSD: if_virt.c,v #include netinet/in_var.h #include rump/rump.h -#include rump/rumpuser.h #include rump_private.h #include rump_net_private.h +#include rumpcomp_user.h + /* * Virtual interface for userspace purposes. Uses tap(4) to * interface with the kernel and just simply shovels data @@ -69,7 +70,7 @@ static void virtif_stop(struct ifnet *, struct virtif_sc { struct ethercom sc_ec; - int sc_tapfd; + struct virtif_user *sc_viu; bool sc_dying; struct lwp *sc_l_snd, *sc_l_rcv; kmutex_t sc_mtx; @@ -88,27 +89,23 @@ int rump_virtif_create(int num) { struct virtif_sc *sc; + struct virtif_user *viu; struct ifnet *ifp; uint8_t enaddr[ETHER_ADDR_LEN] = { 0xb2, 0x0a, 0x00, 0x0b, 0x0e, 0x01 }; - char tapdev[16]; - int fd, error = 0; + int error = 0; if (num = 0x100) return E2BIG; - snprintf(tapdev, sizeof(tapdev), /dev/tap%d, num); - fd = rumpuser_open(tapdev, RUMPUSER_OPEN_RDWR, error); - if (fd == -1) { - printf(virtif_create: can't open /dev/tap%d: %d\n, - num, error); - return error; - } + if ((viu = rumpcomp_virtif_create(num)) == NULL) + return ENXIO; + enaddr[2] = cprng_fast32() 0xff; enaddr[5] = num; sc = kmem_zalloc(sizeof(*sc), KM_SLEEP); sc-sc_dying = false; - sc-sc_tapfd = fd; + sc-sc_viu = viu; mutex_init(sc-sc_mtx, MUTEX_DEFAULT, IPL_NONE); cv_init(sc-sc_cv, virtsnd); @@ -168,6 +165,8 @@ virtif_unclone(struct ifnet *ifp) cv_broadcast(sc-sc_cv); mutex_exit(sc-sc_mtx); + rumpcomp_virtif_dying(sc-sc_viu); + virtif_stop(ifp, 1); if_down(ifp); @@ -180,7 +179,7 @@ virtif_unclone(struct ifnet *ifp) sc-sc_l_rcv = NULL; } - rumpuser_close(sc-sc_tapfd, NULL); + rumpcomp_virtif_destroy(sc-sc_viu); mutex_destroy(sc-sc_mtx); cv_destroy(sc-sc_cv); @@ -220,7 +219,6 @@ virtif_ioctl(struct ifnet *ifp, u_long c return rv; } -/* just send everything in-context */ static void virtif_start(struct ifnet *ifp) { @@ -252,35 +250,21 @@ virtif_receiver(void *arg) struct virtif_sc *sc = ifp-if_softc; struct mbuf *m; size_t plen = ETHER_MAX_LEN_JUMBO+1; - struct pollfd pfd; ssize_t n; - int error, rv; - - pfd.fd = sc-sc_tapfd; - pfd.events = POLLIN; for (;;) { m = m_gethdr(M_WAIT, MT_DATA); MEXTMALLOC(m, plen, M_WAIT); again: - /* poll, but periodically check if we should die */ - rv = rumpuser_poll(pfd, 1, POLLTIMO_MS, error); if (sc
CVS commit: src/sys/rump/net/lib/libvirtif
Module Name:src Committed By: pooka Date: Wed Mar 13 21:17:32 UTC 2013 Modified Files: src/sys/rump/net/lib/libvirtif: rumpcomp_user.c rumpcomp_user.h Log Message: Fix a few minor issues found by proofreading the diff one last time. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c \ src/sys/rump/net/lib/libvirtif/rumpcomp_user.h 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/net/lib/libvirtif/rumpcomp_user.c diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.1 src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.2 --- src/sys/rump/net/lib/libvirtif/rumpcomp_user.c:1.1 Wed Mar 13 21:13:45 2013 +++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.c Wed Mar 13 21:17:32 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.c,v 1.1 2013/03/13 21:13:45 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.c,v 1.2 2013/03/13 21:17:32 pooka Exp $ */ /* * Copyright (c) 2013 Antti Kantee. All Rights Reserved. @@ -127,7 +127,7 @@ rumpcomp_virtif_send(struct virtif_user /* how often to check for interface going south */ #define POLLTIMO_MS 10 -size_t +ssize_t rumpcomp_virtif_recv(struct virtif_user *viu, void *data, size_t dlen) { void *cookie = rumpuser_component_unschedule(); @@ -145,8 +145,10 @@ rumpcomp_virtif_recv(struct virtif_user rv = poll(pfd, 1, POLLTIMO_MS); if (rv == 0) continue; - if (rv == -1) + if (rv == -1) { + nn = -1; break; + } nn = read(viu-viu_fd, data, dlen); if (nn == -1 errno == EAGAIN) Index: src/sys/rump/net/lib/libvirtif/rumpcomp_user.h diff -u src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.1 src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.2 --- src/sys/rump/net/lib/libvirtif/rumpcomp_user.h:1.1 Wed Mar 13 21:13:45 2013 +++ src/sys/rump/net/lib/libvirtif/rumpcomp_user.h Wed Mar 13 21:17:32 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpcomp_user.h,v 1.1 2013/03/13 21:13:45 pooka Exp $ */ +/* $NetBSD: rumpcomp_user.h,v 1.2 2013/03/13 21:17:32 pooka Exp $ */ /* * Copyright (c) 2013 Antti Kantee. All Rights Reserved. @@ -32,4 +32,4 @@ void rumpcomp_virtif_dying(struct virtif void rumpcomp_virtif_destroy(struct virtif_user *); void rumpcomp_virtif_send(struct virtif_user *, struct iovec *, size_t); -ssize_t rumpcomp_virtif_recv(struct virtif_user *, void *data, size_t); +ssize_t rumpcomp_virtif_recv(struct virtif_user *, void *, size_t);
CVS commit: src/sys/rump/net/lib/libvirtif
Module Name:src Committed By: pooka Date: Thu Mar 14 01:23:35 UTC 2013 Modified Files: src/sys/rump/net/lib/libvirtif: Makefile if_virt.c Log Message: Guess the RUMPCOMP_USER stuff wasn't ready to be in the NetBSD tree yet, so revert previous commits to fix build. I'll look at rereverting when toolchain/47644 is fixed and clean buildtests are again possible. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/rump/net/lib/libvirtif/Makefile cvs rdiff -u -r1.28 -r1.29 src/sys/rump/net/lib/libvirtif/if_virt.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/net/lib/libvirtif/Makefile diff -u src/sys/rump/net/lib/libvirtif/Makefile:1.4 src/sys/rump/net/lib/libvirtif/Makefile:1.5 --- src/sys/rump/net/lib/libvirtif/Makefile:1.4 Wed Mar 13 21:13:45 2013 +++ src/sys/rump/net/lib/libvirtif/Makefile Thu Mar 14 01:23:34 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2013/03/13 21:13:45 pooka Exp $ +# $NetBSD: Makefile,v 1.5 2013/03/14 01:23:34 pooka Exp $ # LIB= rumpnet_virtif @@ -6,9 +6,7 @@ LIB= rumpnet_virtif SRCS= if_virt.c SRCS+= component.c -CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpkern -I${.CURDIR} - -RUMPCOMP_USER= #defined +CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpkern .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/net/lib/libvirtif/if_virt.c diff -u src/sys/rump/net/lib/libvirtif/if_virt.c:1.28 src/sys/rump/net/lib/libvirtif/if_virt.c:1.29 --- src/sys/rump/net/lib/libvirtif/if_virt.c:1.28 Wed Mar 13 21:13:45 2013 +++ src/sys/rump/net/lib/libvirtif/if_virt.c Thu Mar 14 01:23:34 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_virt.c,v 1.28 2013/03/13 21:13:45 pooka Exp $ */ +/* $NetBSD: if_virt.c,v 1.29 2013/03/14 01:23:34 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_virt.c,v 1.28 2013/03/13 21:13:45 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: if_virt.c,v 1.29 2013/03/14 01:23:34 pooka Exp $); #include sys/param.h #include sys/condvar.h @@ -49,12 +49,11 @@ __KERNEL_RCSID(0, $NetBSD: if_virt.c,v #include netinet/in_var.h #include rump/rump.h +#include rump/rumpuser.h #include rump_private.h #include rump_net_private.h -#include rumpcomp_user.h - /* * Virtual interface for userspace purposes. Uses tap(4) to * interface with the kernel and just simply shovels data @@ -70,7 +69,7 @@ static void virtif_stop(struct ifnet *, struct virtif_sc { struct ethercom sc_ec; - struct virtif_user *sc_viu; + int sc_tapfd; bool sc_dying; struct lwp *sc_l_snd, *sc_l_rcv; kmutex_t sc_mtx; @@ -89,23 +88,27 @@ int rump_virtif_create(int num) { struct virtif_sc *sc; - struct virtif_user *viu; struct ifnet *ifp; uint8_t enaddr[ETHER_ADDR_LEN] = { 0xb2, 0x0a, 0x00, 0x0b, 0x0e, 0x01 }; - int error = 0; + char tapdev[16]; + int fd, error = 0; if (num = 0x100) return E2BIG; - if ((viu = rumpcomp_virtif_create(num)) == NULL) - return ENXIO; - + snprintf(tapdev, sizeof(tapdev), /dev/tap%d, num); + fd = rumpuser_open(tapdev, RUMPUSER_OPEN_RDWR, error); + if (fd == -1) { + printf(virtif_create: can't open /dev/tap%d: %d\n, + num, error); + return error; + } enaddr[2] = cprng_fast32() 0xff; enaddr[5] = num; sc = kmem_zalloc(sizeof(*sc), KM_SLEEP); sc-sc_dying = false; - sc-sc_viu = viu; + sc-sc_tapfd = fd; mutex_init(sc-sc_mtx, MUTEX_DEFAULT, IPL_NONE); cv_init(sc-sc_cv, virtsnd); @@ -165,8 +168,6 @@ virtif_unclone(struct ifnet *ifp) cv_broadcast(sc-sc_cv); mutex_exit(sc-sc_mtx); - rumpcomp_virtif_dying(sc-sc_viu); - virtif_stop(ifp, 1); if_down(ifp); @@ -179,7 +180,7 @@ virtif_unclone(struct ifnet *ifp) sc-sc_l_rcv = NULL; } - rumpcomp_virtif_destroy(sc-sc_viu); + rumpuser_close(sc-sc_tapfd, NULL); mutex_destroy(sc-sc_mtx); cv_destroy(sc-sc_cv); @@ -219,6 +220,7 @@ virtif_ioctl(struct ifnet *ifp, u_long c return rv; } +/* just send everything in-context */ static void virtif_start(struct ifnet *ifp) { @@ -250,21 +252,35 @@ virtif_receiver(void *arg) struct virtif_sc *sc = ifp-if_softc; struct mbuf *m; size_t plen = ETHER_MAX_LEN_JUMBO+1; + struct pollfd pfd; ssize_t n; + int error, rv; + + pfd.fd = sc-sc_tapfd; + pfd.events = POLLIN; for (;;) { m = m_gethdr(M_WAIT, MT_DATA); MEXTMALLOC(m, plen, M_WAIT); again: + /* poll, but periodically check if we should die */ + rv = rumpuser_poll(pfd, 1, POLLTIMO_MS, error); if (sc-sc_dying) { m_freem(m); break; } - - n = rumpcomp_virtif_recv(sc-sc_viu, mtod(m, void *), plen); - if (n 0) { - printf(%s: read hypercall failed. host if down?\n, + if (rv == 0) + goto again; + + n = rumpuser_read(sc-sc_tapfd, mtod(m, void *), plen, error); + KASSERT(n ETHER_MAX_LEN_JUMBO); + if (__predict_false(n 0)) { + if (n == -1 error == EAGAIN) { +goto again
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Tue Mar 12 14:03:33 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_dl.c Log Message: DragonFly is in the Solaris camp in the how to access ELF DYN at runtime valley of joy and love. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/librumpuser/rumpuser_dl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_dl.c diff -u src/lib/librumpuser/rumpuser_dl.c:1.14 src/lib/librumpuser/rumpuser_dl.c:1.15 --- src/lib/librumpuser/rumpuser_dl.c:1.14 Sat Mar 9 13:25:17 2013 +++ src/lib/librumpuser/rumpuser_dl.c Tue Mar 12 14:03:32 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_dl.c,v 1.14 2013/03/09 13:25:17 pooka Exp $ */ +/* $NetBSD: rumpuser_dl.c,v 1.15 2013/03/12 14:03:32 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -33,7 +33,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_dl.c,v 1.14 2013/03/09 13:25:17 pooka Exp $); +__RCSID($NetBSD: rumpuser_dl.c,v 1.15 2013/03/12 14:03:32 pooka Exp $); #endif /* !lint */ #include sys/types.h @@ -140,11 +140,11 @@ do { \ * the address the dso is mapped at. On Linux, they seem to contain * the absolute address. I couldn't find anything definite from a quick * read of the standard and therefore I will not go and figure beyond ifdef. - * On Solaris, the main object works differently ... h. + * On Solaris and DragonFly, the main object works differently ... h. */ #if defined(__linux__) #define adjptr(_map_, _ptr_) ((void *)(_ptr_)) -#elif defined(__sun__) +#elif defined(__sun__) || defined(__DragonFly__) #define adjptr(_map_, _ptr_) \ (ismainobj ? (void *)(_ptr_) : (void *)(_map_-l_addr + (_ptr_))) #else
CVS commit: src/sys/kern
Module Name:src Committed By: pooka Date: Mon Mar 11 21:37:54 UTC 2013 Modified Files: src/sys/kern: subr_pool.c Log Message: In pool_cache_put_slow(), pool_get() can block (it does mutex_enter()), so we need to retry if curlwp took a context switch during the call. Otherwise, CPU-local invariants can get screwed up: panic: kernel diagnostic assertion cur-pcg_avail == cur-pcg_size failed This is (was) very easy to reproduce by just running: while : ; do RUMP_NCPU=32 ./a.out ; done where a.out only calls rump_init(). But, any situation there's contention and a pool doesn't have emptygroups would do. To generate a diff of this commit: cvs rdiff -u -r1.199 -r1.200 src/sys/kern/subr_pool.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/kern/subr_pool.c diff -u src/sys/kern/subr_pool.c:1.199 src/sys/kern/subr_pool.c:1.200 --- src/sys/kern/subr_pool.c:1.199 Sat Feb 9 00:31:21 2013 +++ src/sys/kern/subr_pool.c Mon Mar 11 21:37:54 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.199 2013/02/09 00:31:21 christos Exp $ */ +/* $NetBSD: subr_pool.c,v 1.200 2013/03/11 21:37:54 pooka Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010 @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_pool.c,v 1.199 2013/02/09 00:31:21 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_pool.c,v 1.200 2013/03/11 21:37:54 pooka Exp $); #include opt_ddb.h #include opt_lockdebug.h @@ -2261,6 +2261,7 @@ pool_cache_get_paddr(pool_cache_t pc, in static bool __noinline pool_cache_put_slow(pool_cache_cpu_t *cc, int s, void *object) { + struct lwp *l = curlwp; pcg_t *pcg, *cur; uint64_t ncsw; pool_cache_t pc; @@ -2271,6 +2272,7 @@ pool_cache_put_slow(pool_cache_cpu_t *cc pc = cc-cc_cache; pcg = NULL; cc-cc_misses++; + ncsw = l-l_ncsw; /* * If there are no empty groups in the cache then allocate one @@ -2280,6 +2282,16 @@ pool_cache_put_slow(pool_cache_cpu_t *cc if (__predict_true(!pool_cache_disable)) { pcg = pool_get(pc-pc_pcgpool, PR_NOWAIT); } + /* + * If pool_get() blocked, then our view of + * the per-CPU data is invalid: retry. + */ + if (__predict_false(l-l_ncsw != ncsw)) { + if (pcg != NULL) { +pool_put(pc-pc_pcgpool, pcg); + } + return true; + } if (__predict_true(pcg != NULL)) { pcg-pcg_avail = 0; pcg-pcg_size = pc-pc_pcgsize; @@ -2288,7 +2300,6 @@ pool_cache_put_slow(pool_cache_cpu_t *cc /* Lock the cache. */ if (__predict_false(!mutex_tryenter(pc-pc_lock))) { - ncsw = curlwp-l_ncsw; mutex_enter(pc-pc_lock); pc-pc_contended++; @@ -2296,7 +2307,7 @@ pool_cache_put_slow(pool_cache_cpu_t *cc * If we context switched while locking, then our view of * the per-CPU data is invalid: retry. */ - if (__predict_false(curlwp-l_ncsw != ncsw)) { + if (__predict_false(l-l_ncsw != ncsw)) { mutex_exit(pc-pc_lock); if (pcg != NULL) { pool_put(pc-pc_pcgpool, pcg);
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Sun Mar 10 09:18:50 UTC 2013 Modified Files: src/sys/rump: listsrcdirs Log Message: Avoid dependency on curlybrace expansion. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/rump/listsrcdirs 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/listsrcdirs diff -u src/sys/rump/listsrcdirs:1.1 src/sys/rump/listsrcdirs:1.2 --- src/sys/rump/listsrcdirs:1.1 Wed Feb 13 18:45:20 2013 +++ src/sys/rump/listsrcdirs Sun Mar 10 09:18:50 2013 @@ -1,24 +1,35 @@ -# $NetBSD: listsrcdirs,v 1.1 2013/02/13 18:45:20 pooka Exp $ +#!/bin/sh +# +# $NetBSD: listsrcdirs,v 1.2 2013/03/10 09:18:50 pooka Exp $ # # -# Run this script with a shell which supports brace expansion (bash, csh, etc.) -# It will echo all of the NetBSD source directories required to build rump +# This script echoes the NetBSD source directories required to build rump # kernels with TOOLS_BUILDRUMP=yes (used for example by buildrump.sh). # Feed the output to whichever method you use to obtain NetBSD sources, e.g. # -# bash listsrcdirs | xargs cvs -d anon...@anoncvs.netbsd.org:/cvsroot -z3 co -P +# ./listsrcdirs | xargs cvs -d anon...@anoncvs.netbsd.org:/cvsroot -z3 co -P +# +# TODO: avoid checkout of sys/arch, since only sys/arch/*/include +# is required. # -echo src/{build.sh,Makefile,Makefile.inc} \ -src/{sys,tools,common,include} \ -src/share/mk \ -src/etc/{Makefile.params,master.passwd,group} \ -src/lib/lib{c,util} \ -src/lib/librump{user,client,,dev,net,vfs} \ -src/external/bsd/{flex,mdocml,byacc} \ -src/external/historical/nawk \ -src/external/cddl/osnet \ -src/usr.bin/{make,xinstall,config,mktemp,sed,tsort,cksum,m4,mkdep,lorder} \ -src/usr.bin/join \ -src/usr.sbin/mtree +precho () +{ + + pfx=$1 + shift + for arg in $* ; do echo ${pfx}${arg} ; done +} + +precho src/ build.sh Makefile Makefile.inc +precho src/ sys tools common include share/mk +precho src/etc/ Makefile.params master.passwd group +precho src/lib/lib c util rump +precho src/lib/librump user client dev net vfs +precho src/external/bsd/ flex mdocml byacc +precho src/external/cddl/ osnet +precho src/external/historical/ nawk +precho src/usr.bin/ make xinstall config mktemp sed tsort +precho src/usr.bin/ lorder join cksum m4 mkdep +precho src/usr.sbin/ mtree
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Mar 10 11:21:06 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: sleepq.c Log Message: Make RUN_ONCE actually run only once. Also, remove a slightly outdated comment. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/rump/librump/rumpkern/sleepq.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/sleepq.c diff -u src/sys/rump/librump/rumpkern/sleepq.c:1.13 src/sys/rump/librump/rumpkern/sleepq.c:1.14 --- src/sys/rump/librump/rumpkern/sleepq.c:1.13 Fri Jan 28 17:57:03 2011 +++ src/sys/rump/librump/rumpkern/sleepq.c Sun Mar 10 11:21:05 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: sleepq.c,v 1.13 2011/01/28 17:57:03 pooka Exp $ */ +/* $NetBSD: sleepq.c,v 1.14 2013/03/10 11:21:05 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: sleepq.c,v 1.13 2011/01/28 17:57:03 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: sleepq.c,v 1.14 2013/03/10 11:21:05 pooka Exp $); #include sys/param.h #include sys/condvar.h @@ -39,12 +39,6 @@ __KERNEL_RCSID(0, $NetBSD: sleepq.c,v 1 #include rump_private.h -/* - * Flimsy and minimalistic sleepq implementation. This is implemented - * only for the use of callouts in kern_timeout.c. locking etc is - * completely incorrect, horrible, etc etc etc. - */ - syncobj_t sleep_syncobj; static kcondvar_t sq_cv; @@ -60,7 +54,7 @@ sqinit1(void) void sleepq_init(sleepq_t *sq) { - ONCE_DECL(sqctl); + static ONCE_DECL(sqctl); RUN_ONCE(sqctl, sqinit1);
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Sun Mar 10 14:15:54 UTC 2013 Modified Files: src/sys/rump: listsrcdirs Log Message: Add -c, which produces cvs syntax output for the necessary subset of src/sys. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/rump/listsrcdirs 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/listsrcdirs diff -u src/sys/rump/listsrcdirs:1.2 src/sys/rump/listsrcdirs:1.3 --- src/sys/rump/listsrcdirs:1.2 Sun Mar 10 09:18:50 2013 +++ src/sys/rump/listsrcdirs Sun Mar 10 14:15:54 2013 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: listsrcdirs,v 1.2 2013/03/10 09:18:50 pooka Exp $ +# $NetBSD: listsrcdirs,v 1.3 2013/03/10 14:15:54 pooka Exp $ # # @@ -10,9 +10,6 @@ # # ./listsrcdirs | xargs cvs -d anon...@anoncvs.netbsd.org:/cvsroot -z3 co -P # -# TODO: avoid checkout of sys/arch, since only sys/arch/*/include -# is required. -# precho () { @@ -23,7 +20,7 @@ precho () } precho src/ build.sh Makefile Makefile.inc -precho src/ sys tools common include share/mk +precho src/ tools common include share/mk precho src/etc/ Makefile.params master.passwd group precho src/lib/lib c util rump precho src/lib/librump user client dev net vfs @@ -33,3 +30,17 @@ precho src/external/historical/ nawk precho src/usr.bin/ make xinstall config mktemp sed tsort precho src/usr.bin/ lorder join cksum m4 mkdep precho src/usr.sbin/ mtree + +# If -c is given, use CVS syntax to exclude large subdirectories +# of sys. Otherwise just do it wholesale. +if [ ${1} = '-c' ]; then + echo \!src/sys/arch \!src/sys/dev/microcode \ + \!src/sys/dev/pci src/sys + + # pick a few useful archs, namely those mentioned in buildrump.sh + for x in amd64 i386 x86 arm evbarm sparc sparc64 ; do + precho src/sys/arch/${x}/ include ${x} + done +else + echo src/sys +fi
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Mar 10 16:27:11 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern memalloc.c Log Message: Always include subr_vmem.c, even with RUMP_UNREAL_ALLOCATORS=yes (previously it was just missing in that case). Record wchan to unreal pool_init() to avoid memory leak warning. To generate a diff of this commit: cvs rdiff -u -r1.121 -r1.122 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.18 -r1.19 src/sys/rump/librump/rumpkern/memalloc.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.121 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.122 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.121 Sun Dec 30 23:52:12 2012 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Sun Mar 10 16:27:11 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.121 2012/12/30 23:52:12 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.122 2013/03/10 16:27:11 pooka Exp $ # .include ${RUMPTOP}/Makefile.rump @@ -97,10 +97,12 @@ SRCS+= init_sysctl_base.c \ subr_log.c \ subr_lwp_specificdata.c \ subr_once.c \ + subr_percpu.c \ subr_prf.c \ subr_pserialize.c \ subr_specificdata.c \ subr_time.c \ + subr_vmem.c \ subr_workqueue.c \ subr_xcall.c \ sys_descrip.c \ @@ -137,7 +139,7 @@ SRCS+= kern_select_50.c .if defined(RUMP_UNREAL_ALLOCATORS) ${RUMP_UNREAL_ALLOCATORS} == yes CPPFLAGS+= -DRUMP_UNREAL_ALLOCATORS .else -SRCS+= subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c +SRCS+= subr_kmem.c subr_pool.c .endif .ifdef RUMP_LOCKDEBUG Index: src/sys/rump/librump/rumpkern/memalloc.c diff -u src/sys/rump/librump/rumpkern/memalloc.c:1.18 src/sys/rump/librump/rumpkern/memalloc.c:1.19 --- src/sys/rump/librump/rumpkern/memalloc.c:1.18 Fri Jul 20 09:20:05 2012 +++ src/sys/rump/librump/rumpkern/memalloc.c Sun Mar 10 16:27:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: memalloc.c,v 1.18 2012/07/20 09:20:05 pooka Exp $ */ +/* $NetBSD: memalloc.c,v 1.19 2013/03/10 16:27:11 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,14 +26,12 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: memalloc.c,v 1.18 2012/07/20 09:20:05 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: memalloc.c,v 1.19 2013/03/10 16:27:11 pooka Exp $); #include sys/param.h #include sys/kmem.h #include sys/malloc.h -#include sys/percpu.h #include sys/pool.h -#include sys/vmem.h #include rump/rumpuser.h @@ -148,6 +146,7 @@ pool_init(struct pool *pp, size_t size, pp-pr_size = size; pp-pr_align = align; + pp-pr_wchan = wchan; } void @@ -327,68 +326,4 @@ struct pool_allocator pool_allocator_kme .pa_pagesz = 0 }; -void -vmem_rehash_start() -{ - - return; -} - -/* - * A simplified percpu is included in here since subr_percpu.c uses - * the vmem allocator and I don't want to reimplement vmem. So use - * this simplified percpu for non-vmem systems. - */ - -static kmutex_t pcmtx; - -void -percpu_init(void) -{ - - mutex_init(pcmtx, MUTEX_DEFAULT, IPL_NONE); -} - -void -percpu_init_cpu(struct cpu_info *ci) -{ - - /* nada */ -} - -void * -percpu_getref(percpu_t *pc) -{ - - mutex_enter(pcmtx); - return pc; -} - -void -percpu_putref(percpu_t *pc) -{ - - mutex_exit(pcmtx); -} - -percpu_t * -percpu_alloc(size_t size) -{ - - return kmem_alloc(size, KM_SLEEP); -} - -void -percpu_free(percpu_t *pc, size_t size) -{ - - kmem_free(pc, size); -} - -void -percpu_foreach(percpu_t *pc, percpu_callback_t cb, void *arg) -{ - - cb(pc, arg, rump_cpu); -} #endif /* RUMP_UNREAL_ALLOCATORS */
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Mar 10 16:51:31 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: rump.c rump_private.h threads.c Log Message: Don't allow kernel threads to run before all CPUs have been initialized to avoid them getting scheduled on non-initialized CPUs. To generate a diff of this commit: cvs rdiff -u -r1.255 -r1.256 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.73 -r1.74 src/sys/rump/librump/rumpkern/rump_private.h cvs rdiff -u -r1.17 -r1.18 src/sys/rump/librump/rumpkern/threads.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/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.255 src/sys/rump/librump/rumpkern/rump.c:1.256 --- src/sys/rump/librump/rumpkern/rump.c:1.255 Fri Mar 8 19:04:28 2013 +++ src/sys/rump/librump/rumpkern/rump.c Sun Mar 10 16:51:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.255 2013/03/08 19:04:28 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.256 2013/03/10 16:51:31 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.255 2013/03/08 19:04:28 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.256 2013/03/10 16:51:31 pooka Exp $); #include sys/systm.h #define ELFSIZE ARCH_ELFSIZE @@ -267,6 +267,7 @@ rump__init(int rump_version) } else { numcpu = rumpuser_getnhostcpu(); } + rump_thread_init(); rump_cpus_bootstrap(numcpu); rumpuser_gettime(sec, nsec, error); @@ -385,6 +386,9 @@ rump__init(int rump_version) aprint_verbose(cpu%d at thinair0: rump virtual cpu\n, i); } + /* CPUs are up. allow kernel threads to run */ + rump_thread_allow(); + mksysctls(); kqueue_init(); iostat_init(); Index: src/sys/rump/librump/rumpkern/rump_private.h diff -u src/sys/rump/librump/rumpkern/rump_private.h:1.73 src/sys/rump/librump/rumpkern/rump_private.h:1.74 --- src/sys/rump/librump/rumpkern/rump_private.h:1.73 Tue Feb 19 09:04:54 2013 +++ src/sys/rump/librump/rumpkern/rump_private.h Sun Mar 10 16:51:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_private.h,v 1.73 2013/02/19 09:04:54 martin Exp $ */ +/* $NetBSD: rump_private.h,v 1.74 2013/03/10 16:51:31 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -141,4 +141,7 @@ void rump_hyperfree(void *, size_t); void rump_xc_highpri(struct cpu_info *); +void rump_thread_init(void); +void rump_thread_allow(void); + #endif /* _SYS_RUMP_PRIVATE_H_ */ Index: src/sys/rump/librump/rumpkern/threads.c diff -u src/sys/rump/librump/rumpkern/threads.c:1.17 src/sys/rump/librump/rumpkern/threads.c:1.18 --- src/sys/rump/librump/rumpkern/threads.c:1.17 Sun Nov 4 14:40:47 2012 +++ src/sys/rump/librump/rumpkern/threads.c Sun Mar 10 16:51:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: threads.c,v 1.17 2012/11/04 14:40:47 pooka Exp $ */ +/* $NetBSD: threads.c,v 1.18 2013/03/10 16:51:31 pooka Exp $ */ /* * Copyright (c) 2007-2009 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: threads.c,v 1.17 2012/11/04 14:40:47 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: threads.c,v 1.18 2013/03/10 16:51:31 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -48,6 +48,10 @@ struct kthdesc { struct lwp *mylwp; }; +static bool threads_are_go; +static struct rumpuser_mtx *thrmtx; +static struct rumpuser_cv *thrcv; + static void * threadbouncer(void *arg) { @@ -59,6 +63,15 @@ threadbouncer(void *arg) f = k-f; thrarg = k-arg; + /* don't allow threads to run before all CPUs have fully attached */ + if (!threads_are_go) { + rumpuser_mutex_enter_nowrap(thrmtx); + while (!threads_are_go) { + rumpuser_cv_wait_nowrap(thrcv, thrmtx); + } + rumpuser_mutex_exit(thrmtx); + } + /* schedule ourselves */ rumpuser_set_curlwp(l); rump_schedule(); @@ -74,6 +87,25 @@ threadbouncer(void *arg) panic(unreachable, should kthread_exit()); } +void +rump_thread_init(void) +{ + + rumpuser_mutex_init(thrmtx); + rumpuser_cv_init(thrcv); +} + +void +rump_thread_allow(void) +{ + + rumpuser_mutex_enter(thrmtx); + threads_are_go = true; + rumpuser_cv_broadcast(thrcv); + rumpuser_mutex_exit(thrmtx); + +} + static struct { const char *t_name; bool t_ncmp;
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Mar 10 17:05:12 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern memalloc.c rump.c vm.c Log Message: Use kern_malloc.c instead of the relegated allocators in memalloc.c. Previously this didn't make sense due to the use of kmem_map, but the new malloc is more dynamic and puts sense into using it. To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.19 -r1.20 src/sys/rump/librump/rumpkern/memalloc.c cvs rdiff -u -r1.256 -r1.257 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.136 -r1.137 src/sys/rump/librump/rumpkern/vm.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.122 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.123 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.122 Sun Mar 10 16:27:11 2013 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Sun Mar 10 17:05:12 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rumpkern,v 1.122 2013/03/10 16:27:11 pooka Exp $ +# $NetBSD: Makefile.rumpkern,v 1.123 2013/03/10 17:05:12 pooka Exp $ # .include ${RUMPTOP}/Makefile.rump @@ -20,7 +20,7 @@ LIB= rump # Source modules, first the ones specifically implemented for librump. # SRCS= rump.c rumpcopy.c emul.c intr.c lwproc.c klock.c \ - kobj_rename.c ltsleep.c memalloc.c scheduler.c \ + kobj_rename.c ltsleep.c scheduler.c \ signals.c sleepq.c threads.c vm.c cprng_stub.c # Multiprocessor or uniprocessor locking. TODO: select right @@ -137,9 +137,9 @@ SRCS+= kern_select_50.c # all kernel corner cases as well (not to mention if you want to debug the # allocators themselves). .if defined(RUMP_UNREAL_ALLOCATORS) ${RUMP_UNREAL_ALLOCATORS} == yes -CPPFLAGS+= -DRUMP_UNREAL_ALLOCATORS +SRCS+= memalloc.c .else -SRCS+= subr_kmem.c subr_pool.c +SRCS+= kern_malloc.c subr_kmem.c subr_pool.c .endif .ifdef RUMP_LOCKDEBUG Index: src/sys/rump/librump/rumpkern/memalloc.c diff -u src/sys/rump/librump/rumpkern/memalloc.c:1.19 src/sys/rump/librump/rumpkern/memalloc.c:1.20 --- src/sys/rump/librump/rumpkern/memalloc.c:1.19 Sun Mar 10 16:27:11 2013 +++ src/sys/rump/librump/rumpkern/memalloc.c Sun Mar 10 17:05:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: memalloc.c,v 1.19 2013/03/10 16:27:11 pooka Exp $ */ +/* $NetBSD: memalloc.c,v 1.20 2013/03/10 17:05:12 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,13 +26,15 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: memalloc.c,v 1.19 2013/03/10 16:27:11 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: memalloc.c,v 1.20 2013/03/10 17:05:12 pooka Exp $); #include sys/param.h #include sys/kmem.h #include sys/malloc.h #include sys/pool.h +#include uvm/uvm_extern.h + #include rump/rumpuser.h #include rump_private.h @@ -52,6 +54,13 @@ __KERNEL_RCSID(0, $NetBSD: memalloc.c,v * malloc */ +void +kmeminit(void) +{ + + return; +} + void * kern_malloc(unsigned long size, int flags) { @@ -86,7 +95,6 @@ kern_free(void *ptr) * Kmem */ -#ifdef RUMP_UNREAL_ALLOCATORS void kmem_init() { @@ -325,5 +333,3 @@ struct pool_allocator pool_allocator_kme .pa_free = pool_page_free, .pa_pagesz = 0 }; - -#endif /* RUMP_UNREAL_ALLOCATORS */ Index: src/sys/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.256 src/sys/rump/librump/rumpkern/rump.c:1.257 --- src/sys/rump/librump/rumpkern/rump.c:1.256 Sun Mar 10 16:51:31 2013 +++ src/sys/rump/librump/rumpkern/rump.c Sun Mar 10 17:05:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.256 2013/03/10 16:51:31 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.257 2013/03/10 17:05:12 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.256 2013/03/10 16:51:31 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.257 2013/03/10 17:05:12 pooka Exp $); #include sys/systm.h #define ELFSIZE ARCH_ELFSIZE @@ -309,6 +309,7 @@ rump__init(int rump_version) prop_kern_init(); kmem_init(); + kmeminit(); uvm_ra_init(); uao_init(); Index: src/sys/rump/librump/rumpkern/vm.c diff -u src/sys/rump/librump/rumpkern/vm.c:1.136 src/sys/rump/librump/rumpkern/vm.c:1.137 --- src/sys/rump/librump/rumpkern/vm.c:1.136 Wed Mar 6 11:42:18 2013 +++ src/sys/rump/librump/rumpkern/vm.c Sun Mar 10 17:05:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vm.c,v 1.136 2013/03/06 11:42:18 yamt Exp $ */ +/* $NetBSD: vm.c,v 1.137 2013/03/10 17:05:12 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -41,7 +41,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.136 2013/03/06 11:42:18 yamt Exp $); +__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.137 2013/03/10 17:05:12
CVS commit: src/sys/kern
Module Name:src Committed By: pooka Date: Sun Mar 10 17:55:42 UTC 2013 Modified Files: src/sys/kern: kern_uidinfo.c Log Message: At least pretend to not leak memory in sysctl initialization. This commit message would be longer if it included opinions about sysctllog vs. CTLFLAG_PERMANENT ... To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/kern/kern_uidinfo.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/kern/kern_uidinfo.c diff -u src/sys/kern/kern_uidinfo.c:1.7 src/sys/kern/kern_uidinfo.c:1.8 --- src/sys/kern/kern_uidinfo.c:1.7 Sat Jun 9 02:55:32 2012 +++ src/sys/kern/kern_uidinfo.c Sun Mar 10 17:55:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_uidinfo.c,v 1.7 2012/06/09 02:55:32 christos Exp $ */ +/* $NetBSD: kern_uidinfo.c,v 1.8 2013/03/10 17:55:42 pooka Exp $ */ /*- * Copyright (c) 1982, 1986, 1991, 1993 @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_uidinfo.c,v 1.7 2012/06/09 02:55:32 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_uidinfo.c,v 1.8 2013/03/10 17:55:42 pooka Exp $); #include sys/param.h #include sys/systm.h @@ -85,13 +85,13 @@ sysctl_kern_uidinfo_cnt(SYSCTLFN_ARGS) return EINVAL; } +static struct sysctllog *kern_uidinfo_sysctllog; + static void sysctl_kern_uidinfo_setup(void) { const struct sysctlnode *rnode, *cnode; - struct sysctllog *kern_uidinfo_sysctllog; - kern_uidinfo_sysctllog = NULL; sysctl_createv(kern_uidinfo_sysctllog, 0, NULL, rnode, CTLFLAG_PERMANENT, CTLTYPE_NODE, uidinfo,
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Sat Mar 9 13:25:18 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_dl.c Log Message: Tiny fix for Solaris. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/librumpuser/rumpuser_dl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_dl.c diff -u src/lib/librumpuser/rumpuser_dl.c:1.13 src/lib/librumpuser/rumpuser_dl.c:1.14 --- src/lib/librumpuser/rumpuser_dl.c:1.13 Fri Mar 8 19:04:27 2013 +++ src/lib/librumpuser/rumpuser_dl.c Sat Mar 9 13:25:17 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_dl.c,v 1.13 2013/03/08 19:04:27 pooka Exp $ */ +/* $NetBSD: rumpuser_dl.c,v 1.14 2013/03/09 13:25:17 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -33,7 +33,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_dl.c,v 1.13 2013/03/08 19:04:27 pooka Exp $); +__RCSID($NetBSD: rumpuser_dl.c,v 1.14 2013/03/09 13:25:17 pooka Exp $); #endif /* !lint */ #include sys/types.h @@ -146,13 +146,13 @@ do { \ #define adjptr(_map_, _ptr_) ((void *)(_ptr_)) #elif defined(__sun__) #define adjptr(_map_, _ptr_) \ -(mainmap_p(_map_) ? (void *)(_ptr_) : (void *)(_map_-l_addr + (_ptr_))) +(ismainobj ? (void *)(_ptr_) : (void *)(_map_-l_addr + (_ptr_))) #else #define adjptr(_map_, _ptr_) ((void *)(_map_-l_addr + (_ptr_))) #endif static int -getsymbols(struct link_map *map) +getsymbols(struct link_map *map, int ismainobj) { char *str_base; void *syms_base = NULL; /* XXXgcc */ @@ -394,7 +394,7 @@ rumpuser_dl_bootstrap(rump_modinit_fn do error = 0; for (map = origmap; map !error; map = map-l_prev) { if (strstr(map-l_name, librump) != NULL || map == mainmap) - error = getsymbols(map); + error = getsymbols(map, map == mainmap); } if (error == 0) {
CVS commit: src
Module Name:src Committed By: pooka Date: Fri Mar 8 08:13:34 UTC 2013 Modified Files: src/external/bsd/mdocml/dist: lib.in src/gnu/usr.bin/groff/tmac: mdoc.local Log Message: Add librumpclient. requested by wiz To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/external/bsd/mdocml/dist/lib.in cvs rdiff -u -r1.71 -r1.72 src/gnu/usr.bin/groff/tmac/mdoc.local Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/mdocml/dist/lib.in diff -u src/external/bsd/mdocml/dist/lib.in:1.12 src/external/bsd/mdocml/dist/lib.in:1.13 --- src/external/bsd/mdocml/dist/lib.in:1.12 Thu Mar 7 21:54:04 2013 +++ src/external/bsd/mdocml/dist/lib.in Fri Mar 8 08:13:34 2013 @@ -87,6 +87,7 @@ LINE(libresolv, DNS Resolver Library LINE(librpcsec_gss, RPC GSS-API Authentication Library (librpcsec_gss, \\-lrpcsec_gss)) LINE(librpcsvc, RPC Service Library (librpcsvc, \\-lrpcsvc)) LINE(librt, POSIX Real\\-time Library (librt, \\-lrt)) +LINE(librumpclient, Clientside stubs for rump kernel remote protocols (librumpclient, \\-lrumpclient)) LINE(libsaslc, Simple Authentication and Security Layer client library (libsaslc, \\-lsaslc)) LINE(libsdp, Bluetooth Service Discovery Protocol User Library (libsdp, \\-lsdp)) LINE(libssp, Buffer Overflow Protection Library (libssp, \\-lssp)) Index: src/gnu/usr.bin/groff/tmac/mdoc.local diff -u src/gnu/usr.bin/groff/tmac/mdoc.local:1.71 src/gnu/usr.bin/groff/tmac/mdoc.local:1.72 --- src/gnu/usr.bin/groff/tmac/mdoc.local:1.71 Thu Mar 7 21:54:04 2013 +++ src/gnu/usr.bin/groff/tmac/mdoc.local Fri Mar 8 08:13:34 2013 @@ -1,4 +1,4 @@ -.\ $NetBSD: mdoc.local,v 1.71 2013/03/07 21:54:04 wiz Exp $ +.\ $NetBSD: mdoc.local,v 1.72 2013/03/08 08:13:34 pooka Exp $ .\ .\ Copyright (c) 2003, 2004 The NetBSD Foundation, Inc. .\ All rights reserved. @@ -101,6 +101,7 @@ .ds doc-str-Lb-libpuffs puffs Convenience Library (libpuffs, \-lpuffs) .ds doc-str-Lb-libquota Disk Quota Access and Control Library (libquota, \-lquota) .ds doc-str-Lb-librefuseFile System in Userspace Convenience Library (librefuse, \-lrefuse) +.ds doc-str-Lb-librumpclient Clientside stubs for rump kernel remote protocols (librumpclient, \-lrumpclient) .ds doc-str-Lb-libsaslc Simple Authentication and Security Layer client library (libsaslc, \-lsaslc) .ds doc-str-Lb-libssp Buffer Overflow Protection Library (libssp, \-lssp) .ds doc-str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo)
CVS commit: src
Module Name:src Committed By: pooka Date: Fri Mar 8 19:04:28 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_dl.c src/sys/rump/include/rump: rumpuser.h src/sys/rump/librump/rumpkern: rump.c Log Message: Ensure that rump kernel component constructors from the main object get processed. This applies to ones which were linked statically. Unfortunately, that's where it got a bit tricky, since the dlsym() interface searches the handle and all its dependencies. For the main object the list of dependencies includes all the dynamic rump kernel components that were included when the binary is linked. So, a long story short, make only one pass through the objects to harvest all the component entries, weed out the dupes, and initialize components from an in-memory dupe-free list when so requested. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/lib/librumpuser/rumpuser_dl.c cvs rdiff -u -r1.74 -r1.75 src/sys/rump/include/rump/rumpuser.h cvs rdiff -u -r1.254 -r1.255 src/sys/rump/librump/rumpkern/rump.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_dl.c diff -u src/lib/librumpuser/rumpuser_dl.c:1.12 src/lib/librumpuser/rumpuser_dl.c:1.13 --- src/lib/librumpuser/rumpuser_dl.c:1.12 Mon Jan 14 21:00:16 2013 +++ src/lib/librumpuser/rumpuser_dl.c Fri Mar 8 19:04:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_dl.c,v 1.12 2013/01/14 21:00:16 pooka Exp $ */ +/* $NetBSD: rumpuser_dl.c,v 1.13 2013/03/08 19:04:27 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -33,7 +33,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_dl.c,v 1.12 2013/01/14 21:00:16 pooka Exp $); +__RCSID($NetBSD: rumpuser_dl.c,v 1.13 2013/03/08 19:04:27 pooka Exp $); #endif /* !lint */ #include sys/types.h @@ -67,12 +67,6 @@ static unsigned char eident; #define Elf_Symindx uint32_t #endif -/* - * Linux ld.so requires a valid handle for dlinfo(), so use the main - * handle. We initialize this variable in rumpuser_dl_bootstrap() - */ -static void *mainhandle; - static void * reservespace(void *store, size_t *storesize, size_t storeoff, size_t required) @@ -146,9 +140,13 @@ do { \ * the address the dso is mapped at. On Linux, they seem to contain * the absolute address. I couldn't find anything definite from a quick * read of the standard and therefore I will not go and figure beyond ifdef. + * On Solaris, the main object works differently ... h. */ -#ifdef __linux__ +#if defined(__linux__) #define adjptr(_map_, _ptr_) ((void *)(_ptr_)) +#elif defined(__sun__) +#define adjptr(_map_, _ptr_) \ +(mainmap_p(_map_) ? (void *)(_ptr_) : (void *)(_map_-l_addr + (_ptr_))) #else #define adjptr(_map_, _ptr_) ((void *)(_map_-l_addr + (_ptr_))) #endif @@ -341,29 +339,24 @@ getsymbols(struct link_map *map) } static void -process(const char *soname, rump_modinit_fn domodinit) +process_object(void *handle, + rump_modinit_fn domodinit, rump_compload_fn docompload) { - void *handle; const struct modinfo *const *mi_start, *const *mi_end; - - if (strstr(soname, librump) == NULL) - return; - - handle = dlopen(soname, RTLD_LAZY); - if (handle == NULL) - return; + struct rump_component *const *rc, *const *rc_end; mi_start = dlsym(handle, __start_link_set_modules); - if (!mi_start) - goto out; mi_end = dlsym(handle, __stop_link_set_modules); - if (!mi_end) - goto out; + if (mi_start mi_end) + domodinit(mi_start, (size_t)(mi_end-mi_start)); - domodinit(mi_start, (size_t)(mi_end-mi_start)); - - out: - dlclose(handle); + rc = dlsym(handle, __start_link_set_rump_components); + rc_end = dlsym(handle, __stop_link_set_rump_components); + if (rc rc_end) { + for (; rc rc_end; rc++) + docompload(*rc); + assert(rc == rc_end); + } } /* @@ -372,17 +365,20 @@ process(const char *soname, rump_modinit */ void rumpuser_dl_bootstrap(rump_modinit_fn domodinit, - rump_symload_fn symload) + rump_symload_fn symload, rump_compload_fn compload) { - struct link_map *map, *origmap; + struct link_map *map, *origmap, *mainmap; + void *mainhandle; int error; mainhandle = dlopen(NULL, RTLD_NOW); - if (dlinfo(mainhandle, RTLD_DI_LINKMAP, origmap) == -1) { + if (dlinfo(mainhandle, RTLD_DI_LINKMAP, mainmap) == -1) { fprintf(stderr, warning: rumpuser module bootstrap failed: %s\n, dlerror()); return; } + origmap = mainmap; + /* * Process last-first because that's the most probable * order for dependencies @@ -397,10 +393,7 @@ rumpuser_dl_bootstrap(rump_modinit_fn do */ error = 0; for (map = origmap; map !error; map = map-l_prev) { - if (strstr(map-l_name, librump) != NULL) - error = getsymbols(map); - /* this should be the main object */ - else if (!map-l_addr map-l_prev == NULL) + if (strstr(map-l_name, librump) != NULL || map
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Thu Mar 7 18:33:27 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: rump.c Log Message: Force references to the component setlist __start/__stop symbols so that they get generated for rump kernels constructed from static libs. To generate a diff of this commit: cvs rdiff -u -r1.252 -r1.253 src/sys/rump/librump/rumpkern/rump.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/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.252 src/sys/rump/librump/rumpkern/rump.c:1.253 --- src/sys/rump/librump/rumpkern/rump.c:1.252 Sun Mar 3 13:11:33 2013 +++ src/sys/rump/librump/rumpkern/rump.c Thu Mar 7 18:33:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.252 2013/03/03 13:11:33 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.253 2013/03/07 18:33:27 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.252 2013/03/03 13:11:33 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.253 2013/03/07 18:33:27 pooka Exp $); #include sys/systm.h #define ELFSIZE ARCH_ELFSIZE @@ -210,11 +210,15 @@ rump_daemonize_done(int error) RUMP_COMPONENT(RUMP_COMPONENT_POSTINIT) { + extern void *__start_link_set_rump_components; + extern void *__stop_link_set_rump_components; /* - * dummy component to make sure at least one component is - * present in every possible rump kernel configuration + * Trick compiler into generating references so that statically + * linked rump kernels are generated with the link set symbols. */ + asm( :: r(__start_link_set_rump_components)); + asm( :: r(__stop_link_set_rump_components)); } int
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Thu Mar 7 18:49:13 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: lwproc.c rumpkern.ifspec Log Message: Support multiple syscall emuls. Rump kernels with only local clients have it easy, since they have to support at most two syscall vectors (some calls such as mount/unmount can be made only through the native NetBSD vector). Remote clients are a whole different tin of green beans. This change addresses local clients only. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/rump/librump/rumpkern/lwproc.c cvs rdiff -u -r1.10 -r1.11 src/sys/rump/librump/rumpkern/rumpkern.ifspec 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/lwproc.c diff -u src/sys/rump/librump/rumpkern/lwproc.c:1.19 src/sys/rump/librump/rumpkern/lwproc.c:1.20 --- src/sys/rump/librump/rumpkern/lwproc.c:1.19 Tue Nov 13 20:10:02 2012 +++ src/sys/rump/librump/rumpkern/lwproc.c Thu Mar 7 18:49:13 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: lwproc.c,v 1.19 2012/11/13 20:10:02 pooka Exp $ */ +/* $NetBSD: lwproc.c,v 1.20 2013/03/07 18:49:13 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: lwproc.c,v 1.19 2012/11/13 20:10:02 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: lwproc.c,v 1.20 2013/03/07 18:49:13 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -44,6 +44,8 @@ __KERNEL_RCSID(0, $NetBSD: lwproc.c,v 1 #include rump_private.h +struct emul *emul_default = emul_netbsd; + static void lwproc_proc_free(struct proc *p) { @@ -90,7 +92,7 @@ lwproc_proc_free(struct proc *p) /* * Allocate a new process. Mostly mimic fork by * copying the properties of the parent. However, there are some - * differences. For example, we never share the fd table. + * differences. * * Switch to the new lwp and return a pointer to it. */ @@ -125,7 +127,7 @@ lwproc_newproc(struct proc *parent, int p-p_stats = pstatscopy(parent-p_stats); p-p_vmspace = vmspace_kernel(); - p-p_emul = emul_netbsd; + p-p_emul = emul_default; if (*parent-p_comm) strcpy(p-p_comm, parent-p_comm); else @@ -400,3 +402,14 @@ rump_lwproc_curlwp(void) return NULL; return l; } + +/* this interface is under construction (like the proverbial 90's web page) */ +int rump_i_know_what_i_am_doing_with_sysents = 0; +void +rump_lwproc_sysent_usenative() +{ + + if (!rump_i_know_what_i_am_doing_with_sysents) + panic(don't use rump_lwproc_sysent_usenative()); + curproc-p_emul = emul_netbsd; +} Index: src/sys/rump/librump/rumpkern/rumpkern.ifspec diff -u src/sys/rump/librump/rumpkern/rumpkern.ifspec:1.10 src/sys/rump/librump/rumpkern/rumpkern.ifspec:1.11 --- src/sys/rump/librump/rumpkern/rumpkern.ifspec:1.10 Sun Jan 2 12:52:25 2011 +++ src/sys/rump/librump/rumpkern/rumpkern.ifspec Thu Mar 7 18:49:13 2013 @@ -1,4 +1,4 @@ -; $NetBSD: rumpkern.ifspec,v 1.10 2011/01/02 12:52:25 pooka Exp $ +; $NetBSD: rumpkern.ifspec,v 1.11 2013/03/07 18:49:13 pooka Exp $ NAME|kern PUBHDR|include/rump/rumpkern_if_pub.h @@ -28,5 +28,6 @@ int |lwproc_newlwp |pid_t void |lwproc_switch |struct lwp * void |lwproc_releaselwp |void struct lwp * |lwproc_curlwp |void +void |lwproc_sysent_usenative|void void |allbetsareoff_setid |pid_t, int
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Thu Mar 7 18:50:18 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: rumpkern_if_priv.h rumpkern_if_wrappers.c To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/rump/librump/rumpkern/rumpkern_if_priv.h \ src/sys/rump/librump/rumpkern/rumpkern_if_wrappers.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/rumpkern_if_priv.h diff -u src/sys/rump/librump/rumpkern/rumpkern_if_priv.h:1.12 src/sys/rump/librump/rumpkern/rumpkern_if_priv.h:1.13 --- src/sys/rump/librump/rumpkern/rumpkern_if_priv.h:1.12 Sun Jan 2 12:53:13 2011 +++ src/sys/rump/librump/rumpkern/rumpkern_if_priv.h Thu Mar 7 18:50:17 2013 @@ -1,9 +1,9 @@ -/* $NetBSD: rumpkern_if_priv.h,v 1.12 2011/01/02 12:53:13 pooka Exp $ */ +/* $NetBSD: rumpkern_if_priv.h,v 1.13 2013/03/07 18:50:17 pooka Exp $ */ /* * Automatically generated. DO NOT EDIT. - * from: NetBSD: rumpkern.ifspec,v 1.10 2011/01/02 12:52:25 pooka Exp - * by: NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp + * from: NetBSD: rumpkern.ifspec,v 1.11 2013/03/07 18:49:13 pooka Exp + * by: NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp */ int rump_getversion(void); @@ -21,4 +21,5 @@ int rump_lwproc_newlwp(pid_t); void rump_lwproc_switch(struct lwp *); void rump_lwproc_releaselwp(void); struct lwp * rump_lwproc_curlwp(void); +void rump_lwproc_sysent_usenative(void); void rump_allbetsareoff_setid(pid_t, int); Index: src/sys/rump/librump/rumpkern/rumpkern_if_wrappers.c diff -u src/sys/rump/librump/rumpkern/rumpkern_if_wrappers.c:1.12 src/sys/rump/librump/rumpkern/rumpkern_if_wrappers.c:1.13 --- src/sys/rump/librump/rumpkern/rumpkern_if_wrappers.c:1.12 Sun Jan 2 12:53:13 2011 +++ src/sys/rump/librump/rumpkern/rumpkern_if_wrappers.c Thu Mar 7 18:50:17 2013 @@ -1,9 +1,9 @@ -/* $NetBSD: rumpkern_if_wrappers.c,v 1.12 2011/01/02 12:53:13 pooka Exp $ */ +/* $NetBSD: rumpkern_if_wrappers.c,v 1.13 2013/03/07 18:50:17 pooka Exp $ */ /* * Automatically generated. DO NOT EDIT. - * from: NetBSD: rumpkern.ifspec,v 1.10 2011/01/02 12:52:25 pooka Exp - * by: NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp + * from: NetBSD: rumpkern.ifspec,v 1.11 2013/03/07 18:49:13 pooka Exp + * by: NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp */ #include sys/cdefs.h @@ -195,6 +195,15 @@ rump_pub_lwproc_curlwp(void) } void +rump_pub_lwproc_sysent_usenative(void) +{ + + rump_schedule(); + rump_lwproc_sysent_usenative(); + rump_unschedule(); +} + +void rump_pub_allbetsareoff_setid(pid_t arg1, int arg2) {
CVS commit: src/sys/rump/include/rump
Module Name:src Committed By: pooka Date: Thu Mar 7 18:51:03 UTC 2013 Modified Files: src/sys/rump/include/rump: rumpkern_if_pub.h Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/sys/rump/include/rump/rumpkern_if_pub.h 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/include/rump/rumpkern_if_pub.h diff -u src/sys/rump/include/rump/rumpkern_if_pub.h:1.13 src/sys/rump/include/rump/rumpkern_if_pub.h:1.14 --- src/sys/rump/include/rump/rumpkern_if_pub.h:1.13 Sun Jan 2 12:53:13 2011 +++ src/sys/rump/include/rump/rumpkern_if_pub.h Thu Mar 7 18:51:02 2013 @@ -1,9 +1,9 @@ -/* $NetBSD: rumpkern_if_pub.h,v 1.13 2011/01/02 12:53:13 pooka Exp $ */ +/* $NetBSD: rumpkern_if_pub.h,v 1.14 2013/03/07 18:51:02 pooka Exp $ */ /* * Automatically generated. DO NOT EDIT. - * from: NetBSD: rumpkern.ifspec,v 1.10 2011/01/02 12:52:25 pooka Exp - * by: NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp + * from: NetBSD: rumpkern.ifspec,v 1.11 2013/03/07 18:49:13 pooka Exp + * by: NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp */ int rump_pub_getversion(void); @@ -21,4 +21,5 @@ int rump_pub_lwproc_newlwp(pid_t); void rump_pub_lwproc_switch(struct lwp *); void rump_pub_lwproc_releaselwp(void); struct lwp * rump_pub_lwproc_curlwp(void); +void rump_pub_lwproc_sysent_usenative(void); void rump_pub_allbetsareoff_setid(pid_t, int);
CVS commit: src/sys/rump/kern/lib/libsys_linux
Module Name:src Committed By: pooka Date: Thu Mar 7 18:53:40 UTC 2013 Modified Files: src/sys/rump/kern/lib/libsys_linux: Makefile component.c Log Message: If linux syscall emulation is linked in to a rump kernel, use it as the default emulation. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/rump/kern/lib/libsys_linux/Makefile cvs rdiff -u -r1.3 -r1.4 src/sys/rump/kern/lib/libsys_linux/component.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/kern/lib/libsys_linux/Makefile diff -u src/sys/rump/kern/lib/libsys_linux/Makefile:1.1 src/sys/rump/kern/lib/libsys_linux/Makefile:1.2 --- src/sys/rump/kern/lib/libsys_linux/Makefile:1.1 Wed Sep 19 21:45:40 2012 +++ src/sys/rump/kern/lib/libsys_linux/Makefile Thu Mar 7 18:53:39 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2012/09/19 21:45:40 pooka Exp $ +# $NetBSD: Makefile,v 1.2 2013/03/07 18:53:39 pooka Exp $ # .PATH: ${.CURDIR}/../../../../compat/linux/common @@ -13,7 +13,7 @@ SRCS= linux_blkio.c linux_cdrom.c linux_ SRCS+= rump_linux_sysent.c component.c # XXX -CPPFLAGS+= -I${.CURDIR} +CPPFLAGS+= -I${.CURDIR} -I${RUMPTOP}/librump/rumpkern .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/kern/lib/libsys_linux/component.c diff -u src/sys/rump/kern/lib/libsys_linux/component.c:1.3 src/sys/rump/kern/lib/libsys_linux/component.c:1.4 --- src/sys/rump/kern/lib/libsys_linux/component.c:1.3 Sat Nov 17 16:38:22 2012 +++ src/sys/rump/kern/lib/libsys_linux/component.c Thu Mar 7 18:53:40 2013 @@ -1,10 +1,12 @@ -/* $NetBSD: component.c,v 1.3 2012/11/17 16:38:22 pooka Exp $ */ +/* $NetBSD: component.c,v 1.4 2013/03/07 18:53:40 pooka Exp $ */ #include sys/param.h #include sys/proc.h #include uvm/uvm_extern.h +#include rump_private.h + extern struct sysent rump_linux_sysent[]; struct emul emul_rump_sys_linux = { @@ -16,6 +18,13 @@ struct emul emul_rump_sys_linux = { #endif }; +RUMP_COMPONENT(RUMP_COMPONENT_KERN) +{ + extern struct emul *emul_default; + + emul_default = emul_rump_sys_linux; +} + /* * XXX: the linux emulation code is not split into factions */
CVS commit: src/sys/rump/kern/lib/libsys_linux
Module Name:src Committed By: pooka Date: Thu Mar 7 18:57:42 UTC 2013 Modified Files: src/sys/rump/kern/lib/libsys_linux: component.c Log Message: implement linux_fakedev: silly in, silly out, silly inside out To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/rump/kern/lib/libsys_linux/component.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/kern/lib/libsys_linux/component.c diff -u src/sys/rump/kern/lib/libsys_linux/component.c:1.4 src/sys/rump/kern/lib/libsys_linux/component.c:1.5 --- src/sys/rump/kern/lib/libsys_linux/component.c:1.4 Thu Mar 7 18:53:40 2013 +++ src/sys/rump/kern/lib/libsys_linux/component.c Thu Mar 7 18:57:42 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: component.c,v 1.4 2013/03/07 18:53:40 pooka Exp $ */ +/* $NetBSD: component.c,v 1.5 2013/03/07 18:57:42 pooka Exp $ */ #include sys/param.h #include sys/proc.h @@ -25,6 +25,16 @@ RUMP_COMPONENT(RUMP_COMPONENT_KERN) emul_default = emul_rump_sys_linux; } +#include compat/linux/common/linux_machdep.h + +dev_t +linux_fakedev(dev_t in, int raw) +{ + + /* I don't really think it matters what we return here */ + return in; +} + /* * XXX: the linux emulation code is not split into factions */
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Thu Mar 7 19:07:06 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: emul.c Log Message: set e_nsysent To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/sys/rump/librump/rumpkern/emul.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/emul.c diff -u src/sys/rump/librump/rumpkern/emul.c:1.153 src/sys/rump/librump/rumpkern/emul.c:1.154 --- src/sys/rump/librump/rumpkern/emul.c:1.153 Tue Feb 19 09:04:54 2013 +++ src/sys/rump/librump/rumpkern/emul.c Thu Mar 7 19:07:05 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: emul.c,v 1.153 2013/02/19 09:04:54 martin Exp $ */ +/* $NetBSD: emul.c,v 1.154 2013/03/07 19:07:05 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: emul.c,v 1.153 2013/02/19 09:04:54 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: emul.c,v 1.154 2013/03/07 19:07:05 pooka Exp $); #include sys/param.h #include sys/null.h @@ -48,6 +48,7 @@ __KERNEL_RCSID(0, $NetBSD: emul.c,v 1.1 #include sys/module.h #include sys/tty.h #include sys/reboot.h +#include sys/syscall.h #include sys/syscallvar.h #include sys/xcall.h #include sys/sleepq.h @@ -128,6 +129,9 @@ struct loadavg averunnable = { struct emul emul_netbsd = { .e_name = netbsd-rump, .e_sysent = rump_sysent, +#ifndef __HAVE_MINIMAL_EMUL + .e_nsysent = SYS_NSYSENT, +#endif .e_vm_default_addr = uvm_default_mapaddr, #ifdef __HAVE_SYSCALL_INTERN .e_syscall_intern = syscall_intern,
CVS commit: src/sys/rump/kern/lib/libsys_linux
Module Name:src Committed By: pooka Date: Thu Mar 7 19:08:54 UTC 2013 Modified Files: src/sys/rump/kern/lib/libsys_linux: syscalls.conf Log Message: generate sysnumhdr so that we get NSYSENT To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/rump/kern/lib/libsys_linux/syscalls.conf 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/kern/lib/libsys_linux/syscalls.conf diff -u src/sys/rump/kern/lib/libsys_linux/syscalls.conf:1.1 src/sys/rump/kern/lib/libsys_linux/syscalls.conf:1.2 --- src/sys/rump/kern/lib/libsys_linux/syscalls.conf:1.1 Wed Sep 19 21:45:40 2012 +++ src/sys/rump/kern/lib/libsys_linux/syscalls.conf Thu Mar 7 19:08:54 2013 @@ -1,8 +1,8 @@ -# $NetBSD: syscalls.conf,v 1.1 2012/09/19 21:45:40 pooka Exp $ +# $NetBSD: syscalls.conf,v 1.2 2013/03/07 19:08:54 pooka Exp $ # sysnames=rump_linux_syscalls.c -sysnumhdr=/dev/null +sysnumhdr=rump_linux_syscall.h syssw=rump_linux_sysent.c sysarghdr=rump_linux_syscallargs.h compatopts=
CVS commit: src/sys/rump/kern/lib/libsys_linux
Module Name:src Committed By: pooka Date: Thu Mar 7 19:09:51 UTC 2013 Modified Files: src/sys/rump/kern/lib/libsys_linux: rump_linux_syscallargs.h rump_linux_syscalls.c rump_linux_sysent.c Added Files: src/sys/rump/kern/lib/libsys_linux: rump_linux_syscall.h Log Message: regen To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 \ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h cvs rdiff -u -r1.3 -r1.4 \ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h \ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c \ src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.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/kern/lib/libsys_linux/rump_linux_syscallargs.h diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.3 src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.4 --- src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h:1.3 Mon Mar 4 19:12:55 2013 +++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscallargs.h Thu Mar 7 19:09:51 2013 @@ -1,10 +1,10 @@ -/* $NetBSD: rump_linux_syscallargs.h,v 1.3 2013/03/04 19:12:55 stacktic Exp $ */ +/* $NetBSD: rump_linux_syscallargs.h,v 1.4 2013/03/07 19:09:51 pooka Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.2 2013/02/17 15:17:40 stacktic Exp + * created from NetBSD: syscalls.master,v 1.3 2013/03/04 19:12:56 stacktic Exp */ #ifndef _RUMP_LINUX_SYS_SYSCALLARGS_H_ Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.3 src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.4 --- src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c:1.3 Mon Mar 4 19:12:55 2013 +++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscalls.c Thu Mar 7 19:09:51 2013 @@ -1,14 +1,14 @@ -/* $NetBSD: rump_linux_syscalls.c,v 1.3 2013/03/04 19:12:55 stacktic Exp $ */ +/* $NetBSD: rump_linux_syscalls.c,v 1.4 2013/03/07 19:09:51 pooka Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.2 2013/02/17 15:17:40 stacktic Exp + * created from NetBSD: syscalls.master,v 1.3 2013/03/04 19:12:56 stacktic Exp */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump_linux_syscalls.c,v 1.3 2013/03/04 19:12:55 stacktic Exp $); +__KERNEL_RCSID(0, $NetBSD: rump_linux_syscalls.c,v 1.4 2013/03/07 19:09:51 pooka Exp $); #if defined(_KERNEL_OPT) #include sys/param.h Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c diff -u src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c:1.3 src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c:1.4 --- src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c:1.3 Mon Mar 4 19:12:56 2013 +++ src/sys/rump/kern/lib/libsys_linux/rump_linux_sysent.c Thu Mar 7 19:09:51 2013 @@ -1,14 +1,14 @@ -/* $NetBSD: rump_linux_sysent.c,v 1.3 2013/03/04 19:12:56 stacktic Exp $ */ +/* $NetBSD: rump_linux_sysent.c,v 1.4 2013/03/07 19:09:51 pooka Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.2 2013/02/17 15:17:40 stacktic Exp + * created from NetBSD: syscalls.master,v 1.3 2013/03/04 19:12:56 stacktic Exp */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump_linux_sysent.c,v 1.3 2013/03/04 19:12:56 stacktic Exp $); +__KERNEL_RCSID(0, $NetBSD: rump_linux_sysent.c,v 1.4 2013/03/07 19:09:51 pooka Exp $); #include sys/param.h #include sys/systm.h Added files: Index: src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h diff -u /dev/null src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h:1.1 --- /dev/null Thu Mar 7 19:09:51 2013 +++ src/sys/rump/kern/lib/libsys_linux/rump_linux_syscall.h Thu Mar 7 19:09:51 2013 @@ -0,0 +1,173 @@ +/* $NetBSD: rump_linux_syscall.h,v 1.1 2013/03/07 19:09:51 pooka Exp $ */ + +/* + * System call numbers. + * + * DO NOT EDIT-- this file is automatically generated. + * created from NetBSD: syscalls.master,v 1.3 2013/03/04 19:12:56 stacktic Exp + */ + +#ifndef _RUMP_LINUX_SYS_SYSCALL_H_ +#define _RUMP_LINUX_SYS_SYSCALL_H_ + +#define RUMP_LINUX_SYS_MAXSYSARGS 8 + +/* syscall: nosys ret: int args: */ +#define RUMP_LINUX_SYS_nosys 0 + +/* syscall: read ret: ssize_t args: int void * size_t */ +#define RUMP_LINUX_SYS_read 3 + +/* syscall: write ret: ssize_t args: int const void * size_t */ +#define RUMP_LINUX_SYS_write 4 + +/* syscall: close ret: int args: int */ +#define RUMP_LINUX_SYS_close 6 + +/* syscall: link ret: int args: const char * const char * */ +#define RUMP_LINUX_SYS_link 9 + +/* syscall: chdir ret: int args: const char * */ +#define RUMP_LINUX_SYS_chdir 12 + +/* syscall: fchdir ret: int args: int */ +#define
CVS commit: src/sys/rump/kern/lib/libsys_linux
Module Name:src Committed By: pooka Date: Thu Mar 7 19:10:59 UTC 2013 Modified Files: src/sys/rump/kern/lib/libsys_linux: component.c Log Message: set e_nsysent To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/rump/kern/lib/libsys_linux/component.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/kern/lib/libsys_linux/component.c diff -u src/sys/rump/kern/lib/libsys_linux/component.c:1.5 src/sys/rump/kern/lib/libsys_linux/component.c:1.6 --- src/sys/rump/kern/lib/libsys_linux/component.c:1.5 Thu Mar 7 18:57:42 2013 +++ src/sys/rump/kern/lib/libsys_linux/component.c Thu Mar 7 19:10:59 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: component.c,v 1.5 2013/03/07 18:57:42 pooka Exp $ */ +/* $NetBSD: component.c,v 1.6 2013/03/07 19:10:59 pooka Exp $ */ #include sys/param.h #include sys/proc.h @@ -7,11 +7,16 @@ #include rump_private.h +#include rump_linux_syscall.h + extern struct sysent rump_linux_sysent[]; struct emul emul_rump_sys_linux = { .e_name = linux-rump, .e_sysent = rump_linux_sysent, +#ifndef __HAVE_MINIMAL_EMUL + .e_nsysent = RUMP_LINUX_SYS_NSYSENT, +#endif .e_vm_default_addr = uvm_default_mapaddr, #ifdef __HAVE_SYSCALL_INTERN .e_syscall_intern = syscall_intern,
CVS commit: src/sys/kern
Module Name:src Committed By: pooka Date: Thu Mar 7 19:17:46 UTC 2013 Modified Files: src/sys/kern: makesyscalls.sh Log Message: make rump kernel syscalls through curproc-p_emul instead of rump_sysent To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128 src/sys/kern/makesyscalls.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/makesyscalls.sh diff -u src/sys/kern/makesyscalls.sh:1.127 src/sys/kern/makesyscalls.sh:1.128 --- src/sys/kern/makesyscalls.sh:1.127 Thu Jan 17 21:30:30 2013 +++ src/sys/kern/makesyscalls.sh Thu Mar 7 19:17:46 2013 @@ -1,4 +1,4 @@ -# $NetBSD: makesyscalls.sh,v 1.127 2013/01/17 21:30:30 pooka Exp $ +# $NetBSD: makesyscalls.sh,v 1.128 2013/03/07 19:17:46 pooka Exp $ # # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou # All rights reserved. @@ -247,10 +247,17 @@ NR == 1 { printf #include \rump_private.h\\n\n rumpcalls printf static int\nrsys_syscall rumpcalls printf (int num, void *data, size_t dlen, register_t *retval) rumpcalls - printf \n{\n\tstruct sysent *callp = rump_sysent + num;\n rumpcalls - printf \tint rv;\n rumpcalls - printf \n\tKASSERT(num 0 num SYS_NSYSENT);\n\n rumpcalls + printf \n{\n\tstruct proc *p;\n rumpcalls + printf \tstruct emul *e;\n rumpcalls + printf \tstruct sysent *callp;\n rumpcalls + printf \tint rv;\n\n rumpcalls printf \trump_schedule();\n rumpcalls + printf \tp = curproc;\n rumpcalls + printf \te = p-p_emul;\n rumpcalls + printf #ifndef __HAVE_MINIMAL_EMUL\n rumpcalls + printf \tKASSERT(num 0 num e-e_nsysent);\n rumpcalls + printf #endif\n rumpcalls + printf \tcallp = e-e_sysent + num;\n\n rumpcalls printf \trv = sy_call(callp, curlwp, data, retval);\n rumpcalls printf \trump_unschedule();\n\n\treturn rv;\n}\n\n rumpcalls printf #define rsys_seterrno(error) rumpuser_seterrno(error)\n rumpcalls
CVS commit: src/sys/rump/dev/lib/libbpf
Module Name:src Committed By: pooka Date: Thu Mar 7 21:21:37 UTC 2013 Modified Files: src/sys/rump/dev/lib/libbpf: component.c Log Message: In retrospect, putting bpf under the dev faction wasn't the smartest thing to do (might have just as well put it under vfs). It's maybe too late to change the name/location, but at least make it attach as part of net so that using bpf does not mandate linking in the dev faction. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/rump/dev/lib/libbpf/component.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/dev/lib/libbpf/component.c diff -u src/sys/rump/dev/lib/libbpf/component.c:1.3 src/sys/rump/dev/lib/libbpf/component.c:1.4 --- src/sys/rump/dev/lib/libbpf/component.c:1.3 Mon Mar 1 13:12:19 2010 +++ src/sys/rump/dev/lib/libbpf/component.c Thu Mar 7 21:21:37 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: component.c,v 1.3 2010/03/01 13:12:19 pooka Exp $ */ +/* $NetBSD: component.c,v 1.4 2013/03/07 21:21:37 pooka Exp $ */ /* * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: component.c,v 1.3 2010/03/01 13:12:19 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: component.c,v 1.4 2013/03/07 21:21:37 pooka Exp $); #include sys/param.h #include sys/conf.h @@ -39,7 +39,7 @@ __KERNEL_RCSID(0, $NetBSD: component.c, #include rump_private.h #include rump_vfs_private.h -RUMP_COMPONENT(RUMP_COMPONENT_DEV) +RUMP_COMPONENT(RUMP_COMPONENT_NET) { extern const struct cdevsw bpf_cdevsw; devmajor_t bmaj, cmaj;
CVS commit: src/sys/rump/librump
Module Name:src Committed By: pooka Date: Thu Mar 7 22:12:35 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: rump.c src/sys/rump/librump/rumpvfs: devnodes.c rump_vfs_private.h Log Message: Make the device node creation routines function pointers which default to nullop without VFS. This relaxes the dependency between VFS and many components, some of which can be used perfectly fine without VFS. To generate a diff of this commit: cvs rdiff -u -r1.253 -r1.254 src/sys/rump/librump/rumpkern/rump.c cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpvfs/devnodes.c cvs rdiff -u -r1.16 -r1.17 src/sys/rump/librump/rumpvfs/rump_vfs_private.h 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/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.253 src/sys/rump/librump/rumpkern/rump.c:1.254 --- src/sys/rump/librump/rumpkern/rump.c:1.253 Thu Mar 7 18:33:27 2013 +++ src/sys/rump/librump/rumpkern/rump.c Thu Mar 7 22:12:34 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.253 2013/03/07 18:33:27 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.254 2013/03/07 22:12:34 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.253 2013/03/07 18:33:27 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.254 2013/03/07 22:12:34 pooka Exp $); #include sys/systm.h #define ELFSIZE ARCH_ELFSIZE @@ -128,6 +128,10 @@ static int rump_inited; void (*rump_vfs_drainbufs)(int); void (*rump_vfs_fini)(void); +int (*rump_vfs_makeonedevnode)(dev_t, const char *, +devmajor_t, devminor_t) = (void *)nullop; +int (*rump_vfs_makedevnodes)(dev_t, const char *, char, + devmajor_t, devminor_t, int) = (void *)nullop; int rump__unavailable(void); int rump__unavailable() {return EOPNOTSUPP;} Index: src/sys/rump/librump/rumpvfs/devnodes.c diff -u src/sys/rump/librump/rumpvfs/devnodes.c:1.7 src/sys/rump/librump/rumpvfs/devnodes.c:1.8 --- src/sys/rump/librump/rumpvfs/devnodes.c:1.7 Fri Sep 21 16:38:54 2012 +++ src/sys/rump/librump/rumpvfs/devnodes.c Thu Mar 7 22:12:34 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: devnodes.c,v 1.7 2012/09/21 16:38:54 joerg Exp $ */ +/* $NetBSD: devnodes.c,v 1.8 2013/03/07 22:12:34 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: devnodes.c,v 1.7 2012/09/21 16:38:54 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: devnodes.c,v 1.8 2013/03/07 22:12:34 pooka Exp $); #include sys/param.h #include sys/device.h @@ -40,8 +40,8 @@ __KERNEL_RCSID(0, $NetBSD: devnodes.c,v #include rump_vfs_private.h /* realqvik(tm) devfs */ -int -rump_vfs_makeonedevnode(dev_t devtype, const char *devname, +static int +makeonedevnode(dev_t devtype, const char *devname, devmajor_t majnum, devminor_t minnum) { register_t retval; @@ -55,8 +55,8 @@ rump_vfs_makeonedevnode(dev_t devtype, c return 0; } -int -rump_vfs_makedevnodes(dev_t devtype, const char *basename, char minchar, +static int +makedevnodes(dev_t devtype, const char *basename, char minchar, devmajor_t maj, devminor_t minnum, int nnodes) { int error = 0; @@ -175,6 +175,9 @@ rump_vfs_builddevs(struct devsw_conv *dc size_t i; int v1, v2; + rump_vfs_makeonedevnode = makeonedevnode; + rump_vfs_makedevnodes = makedevnodes; + for (i = 0; i dcvecsize; i++) { dc = dcvec[i]; Index: src/sys/rump/librump/rumpvfs/rump_vfs_private.h diff -u src/sys/rump/librump/rumpvfs/rump_vfs_private.h:1.16 src/sys/rump/librump/rumpvfs/rump_vfs_private.h:1.17 --- src/sys/rump/librump/rumpvfs/rump_vfs_private.h:1.16 Mon Jan 14 16:45:47 2013 +++ src/sys/rump/librump/rumpvfs/rump_vfs_private.h Thu Mar 7 22:12:34 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_vfs_private.h,v 1.16 2013/01/14 16:45:47 pooka Exp $ */ +/* $NetBSD: rump_vfs_private.h,v 1.17 2013/03/07 22:12:34 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -43,11 +43,12 @@ int rumpblk_init(void); void rump_biodone(void *, size_t, int); -int rump_vfs_makeonedevnode(dev_t, const char *, devmajor_t, devminor_t); -int rump_vfs_makedevnodes(dev_t, const char *, char, - devmajor_t, devminor_t, int); void rump_vfs_builddevs(struct devsw_conv *, size_t numelem); +extern int (*rump_vfs_makeonedevnode)(dev_t, const char *, + devmajor_t, devminor_t); +extern int (*rump_vfs_makedevnodes)(dev_t, const char *, char, + devmajor_t, devminor_t, int); extern void (*rump_vfs_drainbufs)(int); extern void (*rump_vfs_fini)(void);
CVS commit: src/sys/sys
Module Name:src Committed By: pooka Date: Wed Mar 6 18:16:58 UTC 2013 Modified Files: src/sys/sys: ucontext.h Log Message: Move CTASSERT a few lines down so as to not collide with the CTASSERT in rtsock.c (relevant for compilers without __COUNTER__). Yes, it's a really cheap tweak. Tweak better if it tickles your tweakybone. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/sys/ucontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/ucontext.h diff -u src/sys/sys/ucontext.h:1.17 src/sys/sys/ucontext.h:1.18 --- src/sys/sys/ucontext.h:1.17 Wed Sep 12 02:00:54 2012 +++ src/sys/sys/ucontext.h Wed Mar 6 18:16:58 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ucontext.h,v 1.17 2012/09/12 02:00:54 manu Exp $ */ +/* $NetBSD: ucontext.h,v 1.18 2013/03/06 18:16:58 pooka Exp $ */ /*- * Copyright (c) 1999, 2003 The NetBSD Foundation, Inc. @@ -104,15 +104,15 @@ struct __ucontext { #ifdef _KERNEL struct lwp; -#ifdef __UCONTEXT_SIZE -__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE); -#endif - void getucontext(struct lwp *, ucontext_t *); int setucontext(struct lwp *, const ucontext_t *); void cpu_getmcontext(struct lwp *, mcontext_t *, unsigned int *); int cpu_setmcontext(struct lwp *, const mcontext_t *, unsigned int); int cpu_mcontext_validate(struct lwp *, const mcontext_t *); + +#ifdef __UCONTEXT_SIZE +__CTASSERT(sizeof(ucontext_t) == __UCONTEXT_SIZE); +#endif #endif /* _KERNEL */ #endif /* !_SYS_UCONTEXT_H_ */
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Mar 3 13:11:33 UTC 2013 Modified Files: src/sys/rump/librump/rumpkern: rump.c Log Message: Add a dummy component to ensure that at least one component is present in every possible rump kernel configuration. To generate a diff of this commit: cvs rdiff -u -r1.251 -r1.252 src/sys/rump/librump/rumpkern/rump.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/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.251 src/sys/rump/librump/rumpkern/rump.c:1.252 --- src/sys/rump/librump/rumpkern/rump.c:1.251 Tue Feb 19 09:04:54 2013 +++ src/sys/rump/librump/rumpkern/rump.c Sun Mar 3 13:11:33 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.251 2013/02/19 09:04:54 martin Exp $ */ +/* $NetBSD: rump.c,v 1.252 2013/03/03 13:11:33 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.251 2013/02/19 09:04:54 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.252 2013/03/03 13:11:33 pooka Exp $); #include sys/systm.h #define ELFSIZE ARCH_ELFSIZE @@ -208,6 +208,15 @@ rump_daemonize_done(int error) return rumpuser_daemonize_done(error); } +RUMP_COMPONENT(RUMP_COMPONENT_POSTINIT) +{ + + /* + * dummy component to make sure at least one component is + * present in every possible rump kernel configuration + */ +} + int rump__init(int rump_version) {
CVS commit: src/tests/net/bpf
Module Name:src Committed By: pooka Date: Fri Mar 1 13:49:42 UTC 2013 Modified Files: src/tests/net/bpf: t_div-by-zero.c Log Message: Rump kernel hypercalls are not necessary here. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/net/bpf/t_div-by-zero.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/bpf/t_div-by-zero.c diff -u src/tests/net/bpf/t_div-by-zero.c:1.3 src/tests/net/bpf/t_div-by-zero.c:1.4 --- src/tests/net/bpf/t_div-by-zero.c:1.3 Wed Nov 3 16:10:24 2010 +++ src/tests/net/bpf/t_div-by-zero.c Fri Mar 1 13:49:42 2013 @@ -7,7 +7,6 @@ #include fcntl.h #include rump/rump.h -#include rump/rumpuser.h #include rump/rump_syscalls.h ATF_TC(div_by_zero);
CVS commit: src
Module Name:src Committed By: pooka Date: Fri Mar 1 13:52:31 UTC 2013 Modified Files: src/lib/librumpuser: Makefile src/sys/rump/include/rump: rumpuser.h Log Message: limit use of rumpuser.h to where it is meant to be used from To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/lib/librumpuser/Makefile cvs rdiff -u -r1.73 -r1.74 src/sys/rump/include/rump/rumpuser.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/Makefile diff -u src/lib/librumpuser/Makefile:1.6 src/lib/librumpuser/Makefile:1.7 --- src/lib/librumpuser/Makefile:1.6 Wed Mar 21 05:37:44 2012 +++ src/lib/librumpuser/Makefile Fri Mar 1 13:52:31 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2012/03/21 05:37:44 matt Exp $ +# $NetBSD: Makefile,v 1.7 2013/03/01 13:52:31 pooka Exp $ # WARNS?= 5 @@ -8,6 +8,7 @@ WARNS?= 5 LIB= rumpuser LIBDPLIBS+= pthread ${.CURDIR}/../libpthread +CPPFLAGS+= -DLIBRUMPUSER #CPPFLAGS+= -D_DIAGNOSTIC SRCS= rumpuser.c rumpuser_net.c Index: src/sys/rump/include/rump/rumpuser.h diff -u src/sys/rump/include/rump/rumpuser.h:1.73 src/sys/rump/include/rump/rumpuser.h:1.74 --- src/sys/rump/include/rump/rumpuser.h:1.73 Fri Sep 14 16:29:21 2012 +++ src/sys/rump/include/rump/rumpuser.h Fri Mar 1 13:52:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser.h,v 1.73 2012/09/14 16:29:21 pooka Exp $ */ +/* $NetBSD: rumpuser.h,v 1.74 2013/03/01 13:52:31 pooka Exp $ */ /* * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. @@ -28,6 +28,10 @@ #ifndef _RUMP_RUMPUSER_H_ #define _RUMP_RUMPUSER_H_ +#if !defined(_KERNEL) !defined(LIBRUMPUSER) +#error The rump/rumpuser.h interface is not for non-kernel consumers +#endif + #ifdef _KERNEL #include sys/stdint.h #else
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 1 14:05:44 UTC 2013 Modified Files: src/sys/rump: Makefile.rump Log Message: Allow rump kernel components to define their own hypercalls. This is useful for example for supporting the tap device on Linux, for which Linux-specific ioctl's are required (or at least so I was told). To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/rump/Makefile.rump 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/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.68 src/sys/rump/Makefile.rump:1.69 --- src/sys/rump/Makefile.rump:1.68 Thu Nov 22 21:21:21 2012 +++ src/sys/rump/Makefile.rump Fri Mar 1 14:05:43 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.68 2012/11/22 21:21:21 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.69 2013/03/01 14:05:43 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -73,6 +73,31 @@ CPPFLAGS+= -DPPC_OEA DPSRCS+= ${RUMPTOP}/Makefile.rump # +# Support for component-specific hypercalls +# + +.ifdef RUMPUSER_COMPONENT +rumpuser_component.d: rumpuser_component.c + ${_MKTARGET_CREATE} + ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPUSER_COMPONENT_CPPFLAGS} ${.CURDIR}/rumpuser_component.c + +rumpuser_component.o: rumpuser_component.c + ${_MKTARGET_COMPILE} + ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPUSER_COMPONENT_CPPFLAGS} ${RUMPUSER_COMPONENT_CFLAGS} -c ${.CURDIR}/rumpuser_component.c + +rumpuser_component.pico: rumpuser_component.c + ${_MKTARGET_COMPILE} + ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPUSER_COMPONENT_CPPFLAGS} ${RUMPUSER_COMPONENT_CFLAGS} -c ${.CURDIR}/rumpuser_component.c + +rumpuser_component.po: rumpuser_component.c + ${_MKTARGET_COMPILE} + ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPUSER_COMPONENT_CPPFLAGS} ${RUMPUSER_COMPONENT_CFLAGS} -c ${.CURDIR}/rumpuser_component.c + +RUMPUSER_OBJ=rumpuser_component.*o +SRCS+=rumpuser_component.c +.endif + +# # Rename library symbols before use. If a symbol does not already belong # to a rump namespace (rump or RUMP), prefix it with rumpns. This # avoids accidentally linking any kernel symbol against host platform @@ -131,17 +156,19 @@ __archivebuild: .USE .else ${_MKTARGET_BUILD} rm -f ${.TARGET} - ${AR} ${_ARFL} ${.TARGET} `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}` .endif - ${NM} -go ${RUMP_SYMREN:U${.TARGET}} | ${TOOL_AWK} ' \ - $$NF!~/^'${_PQ}'(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}')/ \ - {s = $$NF; sub(/^'${_PQ}'/, rumpns_, s); print $$NF, s}' \ - | sort | uniq renametab.${.TARGET} - ${OBJCOPY} --preserve-dates --redefine-syms \ - renametab.${.TARGET} ${RUMP_SYMREN:U${.TARGET}} - rm -f renametab.${.TARGET} + for obj in ${RUMP_SYMREN:U${.ALLSRC:N${RUMPUSER_OBJ}}}; do \ + ${NM} -go $${obj} | ${TOOL_AWK} ' \ + $$NF!~/^'${_PQ}'(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}')/ \ + {s=$$NF;sub(/^'${_PQ}'/, rumpns_, s); print $$NF, s}'\ + | sort | uniq renametab.$${obj}; \ + ${OBJCOPY} --preserve-dates --redefine-syms \ + renametab.$${obj} $${obj}; \ + rm -f renametab.$${obj}; \ + done .if !defined(RUMP_SYMREN) - ${AR} ${_ARRANFL} ${.TARGET} + ${AR} ${_ARFL} ${.TARGET} \ + `NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}` .endif _BSD_IOCONF_MK_USER_=1
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 1 18:11:11 UTC 2013 Modified Files: src/sys/rump: Makefile.rump Log Message: Shuffle the namespaces in the previous around a bit, and make it rumpcomp_user instead of rumpuser_component. This makes sure the rumpuser namespace is used only by librumpuser. To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sys/rump/Makefile.rump 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/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.69 src/sys/rump/Makefile.rump:1.70 --- src/sys/rump/Makefile.rump:1.69 Fri Mar 1 14:05:43 2013 +++ src/sys/rump/Makefile.rump Fri Mar 1 18:11:11 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.69 2013/03/01 14:05:43 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.70 2013/03/01 18:11:11 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -76,25 +76,25 @@ DPSRCS+= ${RUMPTOP}/Makefile.rump # Support for component-specific hypercalls # -.ifdef RUMPUSER_COMPONENT -rumpuser_component.d: rumpuser_component.c +.ifdef RUMPCOMP_USER +rumpcomp_user.d: rumpcomp_user.c ${_MKTARGET_CREATE} - ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPUSER_COMPONENT_CPPFLAGS} ${.CURDIR}/rumpuser_component.c + ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.CURDIR}/rumpcomp_user.c -rumpuser_component.o: rumpuser_component.c +rumpcomp_user.o: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPUSER_COMPONENT_CPPFLAGS} ${RUMPUSER_COMPONENT_CFLAGS} -c ${.CURDIR}/rumpuser_component.c + ${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c -rumpuser_component.pico: rumpuser_component.c +rumpcomp_user.pico: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPUSER_COMPONENT_CPPFLAGS} ${RUMPUSER_COMPONENT_CFLAGS} -c ${.CURDIR}/rumpuser_component.c + ${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c -rumpuser_component.po: rumpuser_component.c +rumpcomp_user.po: rumpcomp_user.c ${_MKTARGET_COMPILE} - ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPUSER_COMPONENT_CPPFLAGS} ${RUMPUSER_COMPONENT_CFLAGS} -c ${.CURDIR}/rumpuser_component.c + ${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${BUILDRUMP_CFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.CURDIR}/rumpcomp_user.c -RUMPUSER_OBJ=rumpuser_component.*o -SRCS+=rumpuser_component.c +RUMPCOMP_USEROBJ=rumpcomp_user.*o +SRCS+=rumpcomp_user.c .endif # @@ -157,7 +157,7 @@ __archivebuild: .USE ${_MKTARGET_BUILD} rm -f ${.TARGET} .endif - for obj in ${RUMP_SYMREN:U${.ALLSRC:N${RUMPUSER_OBJ}}}; do \ + for obj in ${RUMP_SYMREN:U${.ALLSRC:N${RUMPCOMP_USEROBJ}}}; do \ ${NM} -go $${obj} | ${TOOL_AWK} ' \ $$NF!~/^'${_PQ}'(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}')/ \ {s=$$NF;sub(/^'${_PQ}'/, rumpns_, s); print $$NF, s}'\
CVS commit: src
:1.7 src/distrib/sets/lists/debug/md.sparc64:1.8 --- src/distrib/sets/lists/debug/md.sparc64:1.7 Sat Feb 16 21:40:38 2013 +++ src/distrib/sets/lists/debug/md.sparc64 Fri Mar 1 18:15:39 2013 @@ -1,4 +1,4 @@ -# $NetBSD: md.sparc64,v 1.7 2013/02/16 21:40:38 jmmv Exp $ +# $NetBSD: md.sparc64,v 1.8 2013/03/01 18:15:39 pooka Exp $ ./usr/libdata/debug/sbin/edlabel.debug comp-sysutil-debug obsolete ./usr/libdata/debug/usr/bin/fdformat.debug comp-util-debug debug ./usr/libdata/debug/usr/lib/sparc/i18n/libBIG5.so.5.0.debug comp-i18n-shlib compat,pic,debug @@ -129,7 +129,7 @@ ./usr/libdata/debug/usr/lib/sparc/librumpdev.so.0.0.debug comp-compat-shlib compat,pic,debug,rump ./usr/libdata/debug/usr/lib/sparc/librumphijack.so.0.0.debug comp-compat-shlib compat,pic,debug,rump ./usr/libdata/debug/usr/lib/sparc/librumpnet.so.0.0.debug comp-compat-shlib compat,pic,debug,rump -./usr/libdata/debug/usr/lib/sparc/librumpuser.so.0.0.debug comp-compat-shlib compat,pic,debug,rump +./usr/libdata/debug/usr/lib/sparc/librumpuser.so.0.1.debug comp-compat-shlib compat,pic,debug,rump ./usr/libdata/debug/usr/lib/sparc/librumpvfs.so.0.0.debug comp-compat-shlib compat,pic,debug,rump ./usr/libdata/debug/usr/lib/sparc/libsaslc.so.0.0.debug comp-compat-shlib compat,pic,debug,crypto ./usr/libdata/debug/usr/lib/sparc/libskey.so.2.0.debug comp-compat-shlib compat,pic,debug,skey Index: src/distrib/sets/lists/debug/shl.mi diff -u src/distrib/sets/lists/debug/shl.mi:1.8 src/distrib/sets/lists/debug/shl.mi:1.9 --- src/distrib/sets/lists/debug/shl.mi:1.8 Sat Feb 16 21:40:39 2013 +++ src/distrib/sets/lists/debug/shl.mi Fri Mar 1 18:15:39 2013 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.8 2013/02/16 21:40:39 jmmv Exp $ +# $NetBSD: shl.mi,v 1.9 2013/03/01 18:15:39 pooka Exp $ ./usr/libdata/debug/usr/lib/i18n/libBIG5.so.5.0.debug comp-i18n-debug debug ./usr/libdata/debug/usr/lib/i18n/libDECHanyu.so.5.0.debug comp-i18n-debug debug ./usr/libdata/debug/usr/lib/i18n/libEUC.so.5.0.debug comp-i18n-debug debug @@ -195,7 +195,7 @@ ./usr/libdata/debug/usr/lib/librumpnet_shmif.so.0.0.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpnet_sockin.so.0.0.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpnet_virtif.so.0.0.debug comp-rump-debug debug,rump -./usr/libdata/debug/usr/lib/librumpuser.so.0.0.debug comp-rump-debug debug,rump +./usr/libdata/debug/usr/lib/librumpuser.so.0.1.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpvfs.so.0.0.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpvfs_fifofs.so.0.0.debug comp-rump-debug debug,rump ./usr/libdata/debug/usr/lib/librumpvfs_layerfs.so.0.0.debug comp-rump-debug debug,rump Index: src/lib/librumpuser/Makefile diff -u src/lib/librumpuser/Makefile:1.7 src/lib/librumpuser/Makefile:1.8 --- src/lib/librumpuser/Makefile:1.7 Fri Mar 1 13:52:31 2013 +++ src/lib/librumpuser/Makefile Fri Mar 1 18:15:36 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2013/03/01 13:52:31 pooka Exp $ +# $NetBSD: Makefile,v 1.8 2013/03/01 18:15:36 pooka Exp $ # WARNS?= 5 @@ -14,9 +14,10 @@ CPPFLAGS+= -DLIBRUMPUSER SRCS= rumpuser.c rumpuser_net.c SRCS+= rumpuser_pth.c SRCS+= rumpuser_dl.c rumpuser_sp.c rumpuser_daemonize.c +SRCS+= rumpuser_component.c INCSDIR= /usr/include/rump -INCS= rumpuser.h +INCS= rumpuser.h rumpuser_component.h MAN= rumpuser.3 Index: src/lib/librumpuser/shlib_version diff -u src/lib/librumpuser/shlib_version:1.1 src/lib/librumpuser/shlib_version:1.2 --- src/lib/librumpuser/shlib_version:1.1 Fri Feb 26 18:54:20 2010 +++ src/lib/librumpuser/shlib_version Fri Mar 1 18:15:36 2013 @@ -1,4 +1,6 @@ -# $NetBSD: shlib_version,v 1.1 2010/02/26 18:54:20 pooka Exp $ +# $NetBSD: shlib_version,v 1.2 2013/03/01 18:15:36 pooka Exp $ # + +# see comment in rumpuser_component.c major=0 -minor=0 +minor=1 Added files: Index: src/lib/librumpuser/rumpuser_component.c diff -u /dev/null src/lib/librumpuser/rumpuser_component.c:1.1 --- /dev/null Fri Mar 1 18:15:40 2013 +++ src/lib/librumpuser/rumpuser_component.c Fri Mar 1 18:15:36 2013 @@ -0,0 +1,60 @@ +/* $NetBSD: rumpuser_component.c,v 1.1 2013/03/01 18:15:36 pooka Exp $ */ + +/* + * Copyright (c) 2013 Antti Kantee. All Rights Reserved. + * + * 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 AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Fri Mar 1 18:57:59 UTC 2013 Modified Files: src/sys/rump: VERSION Log Message: Bump tree version for rumpcomp_user stuff. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/rump/VERSION 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/VERSION diff -u src/sys/rump/VERSION:1.4 src/sys/rump/VERSION:1.5 --- src/sys/rump/VERSION:1.4 Thu Jan 31 19:16:11 2013 +++ src/sys/rump/VERSION Fri Mar 1 18:57:59 2013 @@ -1,4 +1,4 @@ -# $NetBSD: VERSION,v 1.4 2013/01/31 19:16:11 pooka Exp $ +# $NetBSD: VERSION,v 1.5 2013/03/01 18:57:59 pooka Exp $ # # Since cvs does not provide a version number for the entire tree, provide # identifiers which can be used by external parties to check if the NetBSD @@ -9,4 +9,4 @@ # when date is bumped. # -BUILDRUMP=20130131:0 +BUILDRUMP=20130301:0
CVS commit: src/sys/rump/librump
Module Name:src Committed By: pooka Date: Thu Feb 14 10:54:55 UTC 2013 Modified Files: src/sys/rump/librump: makerumpif.sh Log Message: Make it possible to manually specify the top level directory; for cases where the target hierarchy is outside of the main tree. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/rump/librump/makerumpif.sh 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/makerumpif.sh diff -u src/sys/rump/librump/makerumpif.sh:1.5 src/sys/rump/librump/makerumpif.sh:1.6 --- src/sys/rump/librump/makerumpif.sh:1.5 Wed Sep 1 19:32:11 2010 +++ src/sys/rump/librump/makerumpif.sh Thu Feb 14 10:54:54 2013 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp $ +# $NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp $ # # Copyright (c) 2009 Antti Kantee. All rights reserved. # @@ -47,14 +47,25 @@ boom () exit 1 } -[ $# != 1 ] usage +unset TOPDIR +if [ $# -eq 3 ]; then + if [ $1 = '-R' ]; then + TOPDIR=$2 + else + usage + fi + shift; shift +fi +[ $# -ne 1 ] usage MYDIR=`pwd` -while [ ! -f Makefile.rump ]; do - [ `pwd` = '/' ] boom Could not find rump topdir. - cd .. -done -RUMPTOP=`pwd` +if [ -z ${TOPDIR} ]; then + while [ ! -f Makefile.rump ]; do + [ `pwd` = '/' ] boom Could not find rump topdir. + cd .. + done + TOPDIR=`pwd` +fi cd ${MYDIR} sed -e ' @@ -64,12 +75,12 @@ sed -e ' s/[ ]*\\\n[ ]*/ / b again } -' ${1} | awk -F\| -v rumptop=${RUMPTOP} ' +' ${1} | awk -F\| -v topdir=${TOPDIR} ' function fileheaders(file, srcstr) { - printf(/*\t$NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp $\t*/\n\n) file + printf(/*\t$NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp $\t*/\n\n) file printf(/*\n * Automatically generated. DO NOT EDIT.\n) file - genstr = $NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp $ + genstr = $NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp $ gsub(\\$, , genstr) printf( * from: %s\n, srcstr) file printf( * by: %s\n, genstr) file @@ -91,9 +102,9 @@ NR == 1 { } $1 == NAME{myname = $2;next} -$1 == PUBHDR{pubhdr = rumptop / $2;print pubhdr;next} -$1 == PRIVHDR{privhdr = rumptop / $2;print privhdr;next} -$1 == WRAPPERS{gencalls = rumptop / $2;print gencalls;next} +$1 == PUBHDR{pubhdr = topdir / $2;print pubhdr;next} +$1 == PRIVHDR{privhdr = topdir / $2;print privhdr;next} +$1 == WRAPPERS{gencalls = topdir / $2;print gencalls;next} /^;/{next} /\\$/{sub(\\\n, );getline nextline;$0 = $0 nextline}
CVS commit: src/lib/libc/gen
Module Name:src Committed By: pooka Date: Wed Feb 13 12:15:09 UTC 2013 Modified Files: src/lib/libc/gen: vis.c Log Message: Match prototype with reality to fix tool build on platforms where wint_t != int. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.47 src/lib/libc/gen/vis.c:1.48 --- src/lib/libc/gen/vis.c:1.47 Wed Feb 13 04:58:17 2013 +++ src/lib/libc/gen/vis.c Wed Feb 13 12:15:09 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.47 2013/02/13 04:58:17 christos Exp $ */ +/* $NetBSD: vis.c,v 1.48 2013/02/13 12:15:09 pooka Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: vis.c,v 1.47 2013/02/13 04:58:17 christos Exp $); +__RCSID($NetBSD: vis.c,v 1.48 2013/02/13 12:15:09 pooka Exp $); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID($FreeBSD$); @@ -92,7 +92,7 @@ __weak_alias(strvisx,_strvisx) * as M-foo. */ -static wchar_t *do_svis(wchar_t *, int, int, int, const wchar_t *); +static wchar_t *do_svis(wchar_t *, wint_t, int, wint_t, const wchar_t *); #undef BELL #define BELL L'\a'
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Wed Feb 13 18:45:20 UTC 2013 Added Files: src/sys/rump: listsrcdirs Log Message: Move the list of source directories required by TOOLS_BUILDRUMP=yes from the buildrump.sh repo to here. While I don't expect the list to change often, it's a function of the NetBSD source tree -r/-D and therefore easier to maintain here. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/rump/listsrcdirs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/rump/listsrcdirs diff -u /dev/null src/sys/rump/listsrcdirs:1.1 --- /dev/null Wed Feb 13 18:45:20 2013 +++ src/sys/rump/listsrcdirs Wed Feb 13 18:45:20 2013 @@ -0,0 +1,24 @@ +# $NetBSD: listsrcdirs,v 1.1 2013/02/13 18:45:20 pooka Exp $ +# + +# +# Run this script with a shell which supports brace expansion (bash, csh, etc.) +# It will echo all of the NetBSD source directories required to build rump +# kernels with TOOLS_BUILDRUMP=yes (used for example by buildrump.sh). +# Feed the output to whichever method you use to obtain NetBSD sources, e.g. +# +# bash listsrcdirs | xargs cvs -d anon...@anoncvs.netbsd.org:/cvsroot -z3 co -P +# + +echo src/{build.sh,Makefile,Makefile.inc} \ +src/{sys,tools,common,include} \ +src/share/mk \ +src/etc/{Makefile.params,master.passwd,group} \ +src/lib/lib{c,util} \ +src/lib/librump{user,client,,dev,net,vfs} \ +src/external/bsd/{flex,mdocml,byacc} \ +src/external/historical/nawk \ +src/external/cddl/osnet \ +src/usr.bin/{make,xinstall,config,mktemp,sed,tsort,cksum,m4,mkdep,lorder} \ +src/usr.bin/join \ +src/usr.sbin/mtree
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Mon Feb 11 16:02:32 UTC 2013 Modified Files: src/lib/librumpuser: rumpuser_pth.c Log Message: As reported by several people, the signature of pthread_setname_np() varies from one Linux distro to another (didn't suspect it to be *that* _np). Comment out the call on Linux pending autoconf support. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/lib/librumpuser/rumpuser_pth.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/rumpuser_pth.c diff -u src/lib/librumpuser/rumpuser_pth.c:1.11 src/lib/librumpuser/rumpuser_pth.c:1.12 --- src/lib/librumpuser/rumpuser_pth.c:1.11 Mon Jan 14 21:00:16 2013 +++ src/lib/librumpuser/rumpuser_pth.c Mon Feb 11 16:02:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_pth.c,v 1.11 2013/01/14 21:00:16 pooka Exp $ */ +/* $NetBSD: rumpuser_pth.c,v 1.12 2013/02/11 16:02:31 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_pth.c,v 1.11 2013/01/14 21:00:16 pooka Exp $); +__RCSID($NetBSD: rumpuser_pth.c,v 1.12 2013/02/11 16:02:31 pooka Exp $); #endif /* !lint */ #include assert.h @@ -242,9 +242,15 @@ rumpuser_thread_create(void *(*f)(void * if (rv == 0 thrname) pthread_setname_np(ptid, thrname, NULL); #elif defined(__linux__) + /* + * The pthread_setname_np() call varies from one Linux distro to + * another. Comment out the call pending autoconf support. + */ +#if 0 if (rv == 0 thrname) pthread_setname_np(ptid, thrname); #endif +#endif if (joinable) { assert(ptcookie);
CVS commit: src/tools
Module Name:src Committed By: pooka Date: Thu Jan 31 15:22:50 UTC 2013 Modified Files: src/tools: Makefile Log Message: Use TOOLS_BUILDRUMP=yes to restrict building of tools to those required for building rump kernels. This cuts down the NetBSD source tree required by buildrump.sh to a fraction and addresses a size/download time concern from a person packaging rump kernels for Linux. No change to the normal case (tested with several -j32/-j64 builds). reviewed by apb To generate a diff of this commit: cvs rdiff -u -r1.165 -r1.166 src/tools/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tools/Makefile diff -u src/tools/Makefile:1.165 src/tools/Makefile:1.166 --- src/tools/Makefile:1.165 Sun Dec 2 12:25:25 2012 +++ src/tools/Makefile Thu Jan 31 15:22:50 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.165 2012/12/02 12:25:25 apb Exp $ +# $NetBSD: Makefile,v 1.166 2013/01/31 15:22:50 pooka Exp $ .include bsd.own.mk @@ -17,6 +17,12 @@ .endif .endif # MKTOOLS != no +# TOOLS_BUILDRUMP == yes builds only the subset of the tools required +# for building rump kernels and the hypervisor. It is typically used +# when building rump kernels targeted for non-NetBSD systems (via +# buildrump.sh), and should not be set for a regular make build. +TOOLS_BUILDRUMP?=no + .if ${TOOLCHAIN_MISSING} == no .if defined(HAVE_GCC) TOOLCHAIN_BITS= gmake .WAIT @@ -91,20 +97,22 @@ dependall-binstall: dependall-compat # See above for special treatment for host-mkdep, compat, and binstall. # SUBDIR= host-mkdep compat binstall \ - .WAIT mktemp .WAIT sed .WAIT \ - cap_mkdb crunchgen ctags genassym gencat hexdump join \ + .WAIT mktemp .WAIT sed .WAIT +.if ${TOOLS_BUILDRUMP} == no +SUBDIR+= cap_mkdb crunchgen ctags genassym gencat hexdump \ ${LINT_BITS} \ - lorder makewhatis mkdep mtree nbperf .WAIT rpcgen tsort \ - uudecode m4 \ - .WAIT texinfo \ - .WAIT yacc \ - .WAIT awk \ + makewhatis mtree nbperf .WAIT rpcgen uudecode +.endif + +SUBDIR+= join lorder m4 mkdep tsort .WAIT yacc .WAIT awk .WAIT lex + +.if ${TOOLS_BUILDRUMP} == no +SUBDIR += .WAIT texinfo \ .WAIT tic \ - .WAIT lex \ .WAIT pax \ .WAIT ${TOOLCHAIN_BITS} \ ${DTRACE_BITS} \ - asn1_compile cat cksum compile_et config db \ + asn1_compile cat cksum compile_et db \ file lint1 slc \ makefs .WAIT menuc mkcsmapper mkesdb mklocale mknod msgc \ .WAIT disklabel \ @@ -112,6 +120,8 @@ SUBDIR= host-mkdep compat binstall \ .WAIT fdisk \ .WAIT installboot \ pwd_mkdb stat strfile sunlabel zic +.endif +SUBDIR+= .WAIT config .if ${MKLLVM} != no SUBDIR+= \ @@ -130,6 +140,8 @@ SUBDIR+= groff SUBDIR+= mandoc .endif +.if ${TOOLS_BUILDRUMP} == no + .if ${MKMAINTAINERTOOLS:Uno} != no SUBDIR+= autoconf .WAIT gettext .endif @@ -193,6 +205,8 @@ SUBDIR+= elftosb SUBDIR+= mkubootimage .endif +.endif # TOOLCHAIN_BUILDRUMP + check_MKTOOLS: .PHONY .NOTMAIN .if ${MKTOOLS:Uyes} == no @echo '*** WARNING: MKTOOLS is set to no; this will prevent building and'
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Thu Jan 31 19:16:12 UTC 2013 Modified Files: src/sys/rump: VERSION Log Message: bump for TOOLS_BUILDRUMP To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/rump/VERSION 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/VERSION diff -u src/sys/rump/VERSION:1.3 src/sys/rump/VERSION:1.4 --- src/sys/rump/VERSION:1.3 Thu Jan 17 21:53:14 2013 +++ src/sys/rump/VERSION Thu Jan 31 19:16:11 2013 @@ -1,4 +1,4 @@ -# $NetBSD: VERSION,v 1.3 2013/01/17 21:53:14 pooka Exp $ +# $NetBSD: VERSION,v 1.4 2013/01/31 19:16:11 pooka Exp $ # # Since cvs does not provide a version number for the entire tree, provide # identifiers which can be used by external parties to check if the NetBSD @@ -9,4 +9,4 @@ # when date is bumped. # -BUILDRUMP=20130117:0 +BUILDRUMP=20130131:0
CVS commit: src/lib/librumpclient
Module Name:src Committed By: pooka Date: Sun Jan 20 15:23:21 UTC 2013 Modified Files: src/lib/librumpclient: rumpclient.h Log Message: Provide register_t compat on solarisa. (would be nice to handle register_t compat internally instead, but the interface was already exposed in a release) To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/librumpclient/rumpclient.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpclient/rumpclient.h diff -u src/lib/librumpclient/rumpclient.h:1.14 src/lib/librumpclient/rumpclient.h:1.15 --- src/lib/librumpclient/rumpclient.h:1.14 Thu Jan 17 22:16:59 2013 +++ src/lib/librumpclient/rumpclient.h Sun Jan 20 15:23:21 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpclient.h,v 1.14 2013/01/17 22:16:59 pooka Exp $ */ +/* $NetBSD: rumpclient.h,v 1.15 2013/01/20 15:23:21 pooka Exp $ */ /*- * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -38,6 +38,11 @@ #endif /* !__GNUC__ */ #endif /* !__returns_twice */ +#if defined(__sun__) !defined(RUMP_REGISTER_T) +#define RUMP_REGISTER_T long +typedef RUMP_REGISTER_T register_t; +#endif + struct rumpclient_fork; #define rumpclient_vfork() rumpclient__dofork(vfork)