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 Don't use rumpuser_malloc() directly.



details:   https://anonhg.NetBSD.org/src/rev/d210d6672bd0
branches:  trunk
changeset: 755382:d210d6672bd0
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Jun 03 19:36:21 2010 +0000

description:
Don't use rumpuser_malloc() directly.

diffstat:

 sys/rump/librump/rumpkern/memalloc.c |   6 +++---
 sys/rump/librump/rumpkern/threads.c  |  11 +++++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (76 lines):

diff -r e95f20606059 -r d210d6672bd0 sys/rump/librump/rumpkern/memalloc.c
--- a/sys/rump/librump/rumpkern/memalloc.c      Thu Jun 03 19:17:22 2010 +0000
+++ b/sys/rump/librump/rumpkern/memalloc.c      Thu Jun 03 19:36:21 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memalloc.c,v 1.7 2010/06/03 10:56:20 pooka Exp $       */
+/*     $NetBSD: memalloc.c,v 1.8 2010/06/03 19:36:21 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.7 2010/06/03 10:56:20 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: memalloc.c,v 1.8 2010/06/03 19:36:21 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -171,7 +171,7 @@
 {
        pool_cache_t pc;
 
-       pc = rumpuser_malloc(sizeof(*pc), 0);
+       pc = rump_hypermalloc(sizeof(*pc), 0, true, "pcinit");
        pool_cache_bootstrap(pc, size, align, align_offset, flags, wchan,
            palloc, ipl, ctor, dtor, arg);
        return pc;
diff -r e95f20606059 -r d210d6672bd0 sys/rump/librump/rumpkern/threads.c
--- a/sys/rump/librump/rumpkern/threads.c       Thu Jun 03 19:17:22 2010 +0000
+++ b/sys/rump/librump/rumpkern/threads.c       Thu Jun 03 19:36:21 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: threads.c,v 1.10 2010/05/31 23:09:29 pooka Exp $       */
+/*     $NetBSD: threads.c,v 1.11 2010/06/03 19:36:21 pooka Exp $       */
 
 /*
  * Copyright (c) 2007-2009 Antti Kantee.  All Rights Reserved.
@@ -29,12 +29,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: threads.c,v 1.10 2010/05/31 23:09:29 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: threads.c,v 1.11 2010/06/03 19:36:21 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
 #include <sys/kmem.h>
 #include <sys/kthread.h>
+#include <sys/malloc.h>
 #include <sys/systm.h>
 
 #include <machine/stdarg.h>
@@ -59,12 +60,14 @@
 
        f = k->f;
        thrarg = k->arg;
-       rumpuser_free(k);
 
        /* schedule ourselves */
        rumpuser_set_curlwp(l);
        rump_schedule();
 
+       /* free dance struct */
+       free(k, M_TEMP);
+
        if ((curlwp->l_pflag & LP_MPSAFE) == 0)
                KERNEL_LOCK(1, NULL);
 
@@ -133,7 +136,7 @@
        }
        KASSERT(fmt != NULL);
 
-       k = rumpuser_malloc(sizeof(struct kthdesc), 0);
+       k = malloc(sizeof(*k), M_TEMP, M_WAITOK);
        k->f = func;
        k->arg = arg;
        k->mylwp = l = rump_lwp_alloc(0, rump_nextlid());



Home | Main Index | Thread Index | Old Index