Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern put lwp/proc stuff into the same s...
details: https://anonhg.NetBSD.org/src/rev/061f92eb60cb
branches: trunk
changeset: 343013:061f92eb60cb
user: pooka <pooka%NetBSD.org@localhost>
date: Mon Jan 18 23:27:20 2016 +0000
description:
put lwp/proc stuff into the same source module (emul.c -> lwproc.c)
diffstat:
sys/rump/librump/rumpkern/emul.c | 41 +------------------------------------
sys/rump/librump/rumpkern/lwproc.c | 41 ++++++++++++++++++++++++++++++++++++-
2 files changed, 41 insertions(+), 41 deletions(-)
diffs (148 lines):
diff -r c8b9ad03b56a -r 061f92eb60cb sys/rump/librump/rumpkern/emul.c
--- a/sys/rump/librump/rumpkern/emul.c Mon Jan 18 23:21:28 2016 +0000
+++ b/sys/rump/librump/rumpkern/emul.c Mon Jan 18 23:27:20 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: emul.c,v 1.176 2016/01/18 23:21:28 pooka Exp $ */
+/* $NetBSD: emul.c,v 1.177 2016/01/18 23:27:20 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.176 2016/01/18 23:21:28 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.177 2016/01/18 23:27:20 pooka Exp $");
#include <sys/param.h>
#include <sys/cprng.h>
@@ -55,11 +55,6 @@
int nkmempages = PHYSMEM/2; /* from le chapeau */
#undef PHYSMEM
-struct lwp lwp0 = {
- .l_lid = 1,
- .l_proc = &proc0,
- .l_fd = &filedesc0,
-};
struct vnode *rootvp;
dev_t rootdev = NODEV;
@@ -90,8 +85,6 @@
kmutex_t tty_lock;
krwlock_t exec_lock;
-struct lwplist alllwp = LIST_HEAD_INITIALIZER(alllwp);
-
/* sparc doesn't sport constant page size, pretend we have 4k pages */
#ifdef __sparc__
int nbpg = 4096;
@@ -130,8 +123,6 @@
.e_sc_autoload = netbsd_syscalls_autoload,
};
-u_int nprocs = 1;
-
cprng_strong_t *kern_cprng;
/* not used, but need the symbols for pointer comparisons */
@@ -158,34 +149,6 @@
return 0;
}
-void
-lwp_unsleep(lwp_t *l, bool cleanup)
-{
-
- KASSERT(mutex_owned(l->l_mutex));
-
- (*l->l_syncobj->sobj_unsleep)(l, cleanup);
-}
-
-void
-lwp_update_creds(struct lwp *l)
-{
- struct proc *p;
- kauth_cred_t oldcred;
-
- p = l->l_proc;
- oldcred = l->l_cred;
- l->l_prflag &= ~LPR_CRMOD;
-
- mutex_enter(p->p_lock);
- kauth_cred_hold(p->p_cred);
- l->l_cred = p->p_cred;
- mutex_exit(p->p_lock);
-
- if (oldcred != NULL)
- kauth_cred_free(oldcred);
-}
-
vaddr_t
calc_cache_size(vsize_t vasz, int pct, int va_pct)
{
diff -r c8b9ad03b56a -r 061f92eb60cb sys/rump/librump/rumpkern/lwproc.c
--- a/sys/rump/librump/rumpkern/lwproc.c Mon Jan 18 23:21:28 2016 +0000
+++ b/sys/rump/librump/rumpkern/lwproc.c Mon Jan 18 23:27:20 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lwproc.c,v 1.35 2015/04/18 15:49:18 pooka Exp $ */
+/* $NetBSD: lwproc.c,v 1.36 2016/01/18 23:27:20 pooka Exp $ */
/*
* Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved.
@@ -28,7 +28,7 @@
#define RUMP__CURLWP_PRIVATE
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lwproc.c,v 1.35 2015/04/18 15:49:18 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lwproc.c,v 1.36 2016/01/18 23:27:20 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -47,9 +47,46 @@
#include "rump_private.h"
#include "rump_curlwp.h"
+struct lwp lwp0 = {
+ .l_lid = 1,
+ .l_proc = &proc0,
+ .l_fd = &filedesc0,
+};
+struct lwplist alllwp = LIST_HEAD_INITIALIZER(alllwp);
+
+u_int nprocs = 1;
+
struct emul *emul_default = &emul_netbsd;
void
+lwp_unsleep(lwp_t *l, bool cleanup)
+{
+
+ KASSERT(mutex_owned(l->l_mutex));
+
+ (*l->l_syncobj->sobj_unsleep)(l, cleanup);
+}
+
+void
+lwp_update_creds(struct lwp *l)
+{
+ struct proc *p;
+ kauth_cred_t oldcred;
+
+ p = l->l_proc;
+ oldcred = l->l_cred;
+ l->l_prflag &= ~LPR_CRMOD;
+
+ mutex_enter(p->p_lock);
+ kauth_cred_hold(p->p_cred);
+ l->l_cred = p->p_cred;
+ mutex_exit(p->p_lock);
+
+ if (oldcred != NULL)
+ kauth_cred_free(oldcred);
+}
+
+void
rump_lwproc_init(void)
{
Home |
Main Index |
Thread Index |
Old Index