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