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 support kern_resource



details:   https://anonhg.NetBSD.org/src/rev/b96d9b2430a3
branches:  trunk
changeset: 754137:b96d9b2430a3
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Apr 21 16:16:31 2010 +0000

description:
support kern_resource

diffstat:

 sys/rump/librump/rumpkern/Makefile.rumpkern |  10 +++++-----
 sys/rump/librump/rumpkern/emul.c            |  12 ++----------
 sys/rump/librump/rumpkern/rump.c            |  26 ++++++++++++++++++++++----
 sys/rump/librump/rumpkern/scheduler.c       |  11 +++++++++--
 sys/rump/librump/rumpkern/vm.c              |  12 ++++++++++--
 5 files changed, 48 insertions(+), 23 deletions(-)

diffs (204 lines):

diff -r afbd1c7bb342 -r b96d9b2430a3 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Wed Apr 21 16:09:11 2010 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Wed Apr 21 16:16:31 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpkern,v 1.78 2010/04/21 11:38:05 pooka Exp $
+#      $NetBSD: Makefile.rumpkern,v 1.79 2010/04/21 16:16:31 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -39,10 +39,10 @@
 # sys/kern
 SRCS+= init_sysctl_base.c kern_auth.c kern_descrip.c kern_event.c      \
        kern_hook.c kern_ksyms.c kern_malloc_stdtype.c kern_module.c    \
-       kern_mutex_obj.c kern_ntptime.c kern_rate.c kern_stub.c         \
-       kern_syscall.c kern_sysctl.c kern_tc.c kern_timeout.c           \
-       kern_uidinfo.c param.c sys_descrip.c sys_generic.c sys_pipe.c   \
-       sys_select.c syscalls.c
+       kern_mutex_obj.c kern_ntptime.c kern_rate.c kern_resource.c     \
+       kern_stub.c kern_syscall.c kern_sysctl.c kern_tc.c              \
+       kern_timeout.c kern_uidinfo.c param.c sys_descrip.c             \
+       sys_generic.c sys_pipe.c sys_select.c syscalls.c
 
 # sys/kern subr (misc)
 SRCS+= subr_devsw.c subr_callback.c subr_copy.c subr_device.c          \
diff -r afbd1c7bb342 -r b96d9b2430a3 sys/rump/librump/rumpkern/emul.c
--- a/sys/rump/librump/rumpkern/emul.c  Wed Apr 21 16:09:11 2010 +0000
+++ b/sys/rump/librump/rumpkern/emul.c  Wed Apr 21 16:16:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: emul.c,v 1.130 2010/04/21 11:38:05 pooka Exp $ */
+/*     $NetBSD: emul.c,v 1.131 2010/04/21 16:16:31 pooka Exp $ */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.130 2010/04/21 11:38:05 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emul.c,v 1.131 2010/04/21 16:16:31 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/null.h>
@@ -309,11 +309,3 @@
        /* this function is __dead, we must exit */
        rumpuser_exit(0);
 }
-
-void
-calcru(struct proc *p, struct timeval *up, struct timeval *sp,
-        struct timeval *ip, struct timeval *rp)
-{
-
-       panic("%s unimplemented", __func__);
-}
diff -r afbd1c7bb342 -r b96d9b2430a3 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Wed Apr 21 16:09:11 2010 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Wed Apr 21 16:16:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.161 2010/04/17 16:34:29 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.162 2010/04/21 16:16:31 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.161 2010/04/17 16:34:29 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.162 2010/04/21 16:16:31 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -52,6 +52,7 @@
 #include <sys/once.h>
 #include <sys/percpu.h>
 #include <sys/pipe.h>
+#include <sys/pool.h>
 #include <sys/queue.h>
 #include <sys/reboot.h>
 #include <sys/resourcevar.h>
@@ -127,10 +128,23 @@
 
 static int rump_inited;
 
+/*
+ * Make sure pnbuf_cache is available even without vfs
+ */
+struct pool_cache *pnbuf_cache;
+int rump_initpnbufpool(void);
+int rump_initpnbufpool(void)
+{
+
+        pnbuf_cache = pool_cache_init(MAXPATHLEN, 0, 0, 0, "pnbufpl",
+           NULL, IPL_NONE, NULL, NULL, NULL);
+       return EOPNOTSUPP;
+}
+
 int rump__unavailable(void);
 int rump__unavailable() {return EOPNOTSUPP;}
 __weak_alias(rump_net_init,rump__unavailable);
-__weak_alias(rump_vfs_init,rump__unavailable);
+__weak_alias(rump_vfs_init,rump_initpnbufpool);
 __weak_alias(rump_dev_init,rump__unavailable);
 
 __weak_alias(rump_vfs_fini,rump__unavailable);
@@ -278,9 +292,11 @@
        proc_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE);
        lwpinit_specificdata();
 
+       mutex_init(&rump_limits.pl_lock, MUTEX_DEFAULT, IPL_NONE);
        rump_limits.pl_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
        rump_limits.pl_rlimit[RLIMIT_NOFILE].rlim_cur = RLIM_INFINITY;
        rump_limits.pl_rlimit[RLIMIT_SBSIZE].rlim_cur = RLIM_INFINITY;
+       rump_limits.pl_corename = defcorename;
 
        rump_scheduler_init();
        /* revert temporary context and schedule a real context */
@@ -317,6 +333,7 @@
        module_init();
        devsw_init();
        pipe_init();
+       resource_init();
 
        rumpuser_dl_bootstrap(add_linkedin_modules, rump_kernelfsym_load);
 
@@ -479,7 +496,7 @@
                if (rump_proc_vfs_init)
                        rump_proc_vfs_init(p);
                p->p_stats = &rump_stats;
-               p->p_limit = &rump_limits;
+               p->p_limit = lim_copy(&rump_limits);
                p->p_pid = pid;
                p->p_vmspace = &rump_vmspace;
                p->p_emul = &emul_netbsd;
@@ -529,6 +546,7 @@
                if (rump_proc_vfs_release)
                        rump_proc_vfs_release(p);
                rump_cred_put(l->l_cred);
+               limfree(p->p_limit);
                kmem_free(p, sizeof(*p));
        }
        KASSERT((l->l_flag & LW_WEXIT) == 0);
diff -r afbd1c7bb342 -r b96d9b2430a3 sys/rump/librump/rumpkern/scheduler.c
--- a/sys/rump/librump/rumpkern/scheduler.c     Wed Apr 21 16:09:11 2010 +0000
+++ b/sys/rump/librump/rumpkern/scheduler.c     Wed Apr 21 16:16:31 2010 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scheduler.c,v 1.10 2010/04/17 13:13:45 pooka Exp $    */
+/*      $NetBSD: scheduler.c,v 1.11 2010/04/21 16:16:31 pooka Exp $    */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.10 2010/04/17 13:13:45 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.11 2010/04/21 16:16:31 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -306,3 +306,10 @@
         * but skip that for now.
         */
 }
+
+void
+sched_nice(struct proc *p, int level)
+{
+
+       /* nothing to do for now */
+}
diff -r afbd1c7bb342 -r b96d9b2430a3 sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c    Wed Apr 21 16:09:11 2010 +0000
+++ b/sys/rump/librump/rumpkern/vm.c    Wed Apr 21 16:16:31 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm.c,v 1.70 2009/12/04 17:57:16 pooka Exp $    */
+/*     $NetBSD: vm.c,v 1.71 2010/04/21 16:16:31 pooka Exp $    */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.70 2009/12/04 17:57:16 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.71 2010/04/21 16:16:31 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -526,6 +526,14 @@
        return 0;
 }
 
+int
+uvm_map_protect(struct vm_map *map, vaddr_t start, vaddr_t end,
+       vm_prot_t prot, bool set_max)
+{
+
+       return EOPNOTSUPP;
+}
+
 /*
  * UVM km
  */



Home | Main Index | Thread Index | Old Index