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 make unreal allocators work again



details:   https://anonhg.NetBSD.org/src/rev/0ae61ec3875f
branches:  trunk
changeset: 780323:0ae61ec3875f
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Jul 20 09:11:33 2012 +0000

description:
make unreal allocators work again

diffstat:

 sys/rump/librump/rumpkern/memalloc.c |  14 ++++++++++++--
 sys/rump/librump/rumpkern/vm.c       |   7 +++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diffs (77 lines):

diff -r a3dbed70080a -r 0ae61ec3875f sys/rump/librump/rumpkern/memalloc.c
--- a/sys/rump/librump/rumpkern/memalloc.c      Fri Jul 20 09:10:23 2012 +0000
+++ b/sys/rump/librump/rumpkern/memalloc.c      Fri Jul 20 09:11:33 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memalloc.c,v 1.16 2012/06/05 22:51:47 jym Exp $        */
+/*     $NetBSD: memalloc.c,v 1.17 2012/07/20 09:11:33 pooka Exp $      */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.16 2012/06/05 22:51:47 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.17 2012/07/20 09:11:33 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -122,6 +122,10 @@
        rumpuser_free(p);
 }
 
+__strong_alias(kmem_intr_alloc, kmem_alloc);
+__strong_alias(kmem_intr_zalloc, kmem_zalloc);
+__strong_alias(kmem_intr_free, kmem_free);
+
 /*
  * pool & pool_cache
  */
@@ -317,6 +321,12 @@
        return pool_put(pp, item);
 }
 
+struct pool_allocator pool_allocator_kmem = {
+        .pa_alloc = pool_page_alloc,
+        .pa_free = pool_page_free,
+        .pa_pagesz = 0
+};
+
 void
 vmem_rehash_start()
 {
diff -r a3dbed70080a -r 0ae61ec3875f sys/rump/librump/rumpkern/vm.c
--- a/sys/rump/librump/rumpkern/vm.c    Fri Jul 20 09:10:23 2012 +0000
+++ b/sys/rump/librump/rumpkern/vm.c    Fri Jul 20 09:11:33 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm.c,v 1.127 2012/06/05 22:51:47 jym Exp $     */
+/*     $NetBSD: vm.c,v 1.128 2012/07/20 09:11:33 pooka Exp $   */
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.127 2012/06/05 22:51:47 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.128 2012/07/20 09:11:33 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -331,6 +331,8 @@
        kernel_map->pmap = pmap_kernel();
 
        pool_subsystem_init();
+
+#ifndef RUMP_USE_UNREAL_ALLOCATORS
        vmem_bootstrap();
        kmem_arena = vmem_create("kmem", 0, 1024*1024, PAGE_SIZE,
            NULL, NULL, NULL,
@@ -341,6 +343,7 @@
        kmem_va_arena = vmem_create("kva", 0, 0, PAGE_SIZE,
            vmem_alloc, vmem_free, kmem_arena,
            8 * PAGE_SIZE, VM_NOSLEEP | VM_BOOTSTRAP, IPL_VM);
+#endif /* !RUMP_USE_UNREAL_ALLOCATORS */
 
        pool_cache_bootstrap(&pagecache, sizeof(struct vm_page), 0, 0, 0,
            "page$", NULL, IPL_NONE, pgctor, pgdtor, NULL);



Home | Main Index | Thread Index | Old Index