convert from malloc(9) to kmem(9)
This commit is contained in:
parent
2fee8b532f
commit
30980bdf1d
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap.c,v 1.166 2011/06/03 17:03:53 tsutsui Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.167 2012/01/29 16:24:51 para Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
|
@ -80,7 +80,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.166 2011/06/03 17:03:53 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.167 2012/01/29 16:24:51 para Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_pmap_debug.h"
|
||||
|
@ -88,7 +88,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.166 2011/06/03 17:03:53 tsutsui Exp $");
|
|||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/kmem.h>
|
||||
#include <sys/pool.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/kcore.h>
|
||||
|
@ -1849,7 +1849,7 @@ void
|
|||
pmap_user_init(pmap_t pmap)
|
||||
{
|
||||
int i;
|
||||
pmap->pm_segmap = malloc(sizeof(char)*NUSEG, M_VMPMAP, M_WAITOK);
|
||||
pmap->pm_segmap = kmem_alloc(sizeof(char)*NUSEG, KM_SLEEP);
|
||||
for (i = 0; i < NUSEG; i++) {
|
||||
pmap->pm_segmap[i] = SEGINV;
|
||||
}
|
||||
|
@ -1900,7 +1900,7 @@ pmap_release(struct pmap *pmap)
|
|||
#endif
|
||||
context_free(pmap);
|
||||
}
|
||||
free(pmap->pm_segmap, M_VMPMAP);
|
||||
kmem_free(pmap->pm_segmap, sizeof(char)*NUSEG);
|
||||
pmap->pm_segmap = NULL;
|
||||
|
||||
splx(s);
|
||||
|
|
Loading…
Reference in New Issue