Don't use rumpuser_malloc() directly.
This commit is contained in:
parent
be3a3d34c5
commit
c91a51436f
@ -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_init(size_t size, u_int align, u_int align_offset, u_int flags,
|
||||
{
|
||||
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;
|
||||
|
@ -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 @@ threadbouncer(void *arg)
|
||||
|
||||
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 @@ kthread_create(pri_t pri, int flags, struct cpu_info *ci,
|
||||
}
|
||||
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());
|
||||
|
Loading…
Reference in New Issue
Block a user