malloc -> kmem_alloc
This commit is contained in:
parent
7b62ebcbd0
commit
28431d8662
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: firmload.c,v 1.19 2014/03/25 16:19:13 christos Exp $ */
|
||||
/* $NetBSD: firmload.c,v 1.20 2015/01/04 19:24:11 pooka Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.19 2014/03/25 16:19:13 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.20 2015/01/04 19:24:11 pooka Exp $");
|
||||
|
||||
/*
|
||||
* The firmload API provides an interface for device drivers to access
|
||||
@ -40,7 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.19 2014/03/25 16:19:13 christos Exp $
|
||||
#include <sys/param.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/filedesc.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/kmem.h>
|
||||
#include <sys/namei.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysctl.h>
|
||||
@ -50,8 +50,6 @@ __KERNEL_RCSID(0, "$NetBSD: firmload.c,v 1.19 2014/03/25 16:19:13 christos Exp $
|
||||
|
||||
#include <dev/firmload.h>
|
||||
|
||||
MALLOC_DEFINE(M_DEVFIRM, "devfirm", "device firmware buffers");
|
||||
|
||||
struct firmware_handle {
|
||||
struct vnode *fh_vp;
|
||||
off_t fh_size;
|
||||
@ -61,14 +59,14 @@ static firmware_handle_t
|
||||
firmware_handle_alloc(void)
|
||||
{
|
||||
|
||||
return (malloc(sizeof(struct firmware_handle), M_DEVFIRM, M_WAITOK));
|
||||
return (kmem_alloc(sizeof(struct firmware_handle), KM_SLEEP));
|
||||
}
|
||||
|
||||
static void
|
||||
firmware_handle_free(firmware_handle_t fh)
|
||||
{
|
||||
|
||||
free(fh, M_DEVFIRM);
|
||||
kmem_free(fh, sizeof(*fh));
|
||||
}
|
||||
|
||||
#if !defined(FIRMWARE_PATHS)
|
||||
@ -336,7 +334,7 @@ void *
|
||||
firmware_malloc(size_t size)
|
||||
{
|
||||
|
||||
return (malloc(size, M_DEVFIRM, M_WAITOK));
|
||||
return (kmem_alloc(size, KM_SLEEP));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -349,5 +347,5 @@ void
|
||||
firmware_free(void *v, size_t size)
|
||||
{
|
||||
|
||||
free(v, M_DEVFIRM);
|
||||
kmem_free(v, size);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user