Source-Changes-HG archive

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

[src/trunk]: src/sys/rump Pass routines necessary for multithreaded operation...



details:   https://anonhg.NetBSD.org/src/rev/46f9ac94f1ef
branches:  trunk
changeset: 758886:46f9ac94f1ef
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Nov 19 17:06:56 2010 +0000

description:
Pass routines necessary for multithreaded operation down to rumpuser_sp.

diffstat:

 sys/rump/include/rump/rumpuser.h |   6 ++++--
 sys/rump/librump/rumpkern/rump.c |  14 ++++++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diffs (72 lines):

diff -r a95f5ba8edc2 -r 46f9ac94f1ef sys/rump/include/rump/rumpuser.h
--- a/sys/rump/include/rump/rumpuser.h  Fri Nov 19 15:47:32 2010 +0000
+++ b/sys/rump/include/rump/rumpuser.h  Fri Nov 19 17:06:56 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser.h,v 1.50 2010/11/04 20:57:00 pooka Exp $      */
+/*     $NetBSD: rumpuser.h,v 1.51 2010/11/19 17:06:57 pooka Exp $      */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -36,7 +36,7 @@
 #include <stdint.h>
 #endif
 
-#define RUMPUSER_VERSION 3
+#define RUMPUSER_VERSION 4
 int rumpuser_getversion(void);
 
 struct msghdr;
@@ -211,8 +211,10 @@
        void (*spop_lwproc_switch)(struct lwp *);
        void (*spop_lwproc_release)(void);
        int (*spop_lwproc_newproc)(void);
+       int (*spop_lwproc_newlwp)(pid_t);
        struct lwp * (*spop_lwproc_curlwp)(void);
        int (*spop_syscall)(int, void *, register_t *);
+       pid_t (*spop_getpid)(void);
 };
 
 int    rumpuser_sp_init(const struct rumpuser_sp_ops *, const char *);
diff -r a95f5ba8edc2 -r 46f9ac94f1ef sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Fri Nov 19 15:47:32 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Fri Nov 19 17:06:56 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.200 2010/11/17 21:57:33 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.201 2010/11/19 17:06:56 pooka Exp $ */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.200 2010/11/17 21:57:33 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.201 2010/11/19 17:06:56 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -190,14 +190,24 @@
            &hostname, MAXHOSTNAMELEN, CTL_KERN, KERN_HOSTNAME, CTL_EOL);
 }
 
+/* there's no convenient kernel entry point for this, so just craft out own */
+static pid_t
+spgetpid(void)
+{
+
+       return curproc->p_pid;
+}
+
 static const struct rumpuser_sp_ops spops = {
        .spop_schedule          = rump_schedule,
        .spop_unschedule        = rump_unschedule,
        .spop_lwproc_switch     = rump_lwproc_switch,
        .spop_lwproc_release    = rump_lwproc_releaselwp,
        .spop_lwproc_newproc    = rump_lwproc_newproc,
+       .spop_lwproc_newlwp     = rump_lwproc_newlwp,
        .spop_lwproc_curlwp     = rump_lwproc_curlwp,
        .spop_syscall           = rump_proxy_syscall,
+       .spop_getpid            = spgetpid,
 };
 
 int



Home | Main Index | Thread Index | Old Index