Module Name: src
Committed By: pooka
Date: Fri Nov 19 17:06:57 UTC 2010
Modified Files:
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpkern: rump.c
Log Message:
Pass routines necessary for multithreaded operation down to rumpuser_sp.
To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.200 -r1.201 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/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.50 src/sys/rump/include/rump/rumpuser.h:1.51
--- src/sys/rump/include/rump/rumpuser.h:1.50 Thu Nov 4 20:57:00 2010
+++ src/sys/rump/include/rump/rumpuser.h Fri Nov 19 17:06:57 2010
@@ -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 *);
Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.200 src/sys/rump/librump/rumpkern/rump.c:1.201
--- src/sys/rump/librump/rumpkern/rump.c:1.200 Wed Nov 17 21:57:33 2010
+++ src/sys/rump/librump/rumpkern/rump.c Fri Nov 19 17:06:56 2010
@@ -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