Move MALLOC_DEFINE()s from usb_mem.c to usb_subr.c.

usb_mem.c provides functions for DMA memory allocation
that is required by DMA capable host controllers only,
but MALLOC_DEFINE() isn't DMA specific and could be required
by any USB drivers.

Discussed on current-users.
This commit is contained in:
tsutsui 2011-03-20 17:38:11 +00:00
parent 69d595d91e
commit 56293e3413
2 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb_mem.c,v 1.45 2011/01/04 01:37:55 matt Exp $ */
/* $NetBSD: usb_mem.c,v 1.46 2011/03/20 17:38:11 tsutsui Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.45 2011/01/04 01:37:55 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.46 2011/03/20 17:38:11 tsutsui Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@ -75,10 +75,6 @@ extern int usbdebug;
#define DPRINTFN(n,x)
#endif
MALLOC_DEFINE(M_USB, "USB", "USB misc. memory");
MALLOC_DEFINE(M_USBDEV, "USB device", "USB device driver");
MALLOC_DEFINE(M_USBHC, "USB HC", "USB host controller");
#define USB_MEM_SMALL 64
#define USB_MEM_CHUNKS 64
#define USB_MEM_BLOCK (USB_MEM_SMALL * USB_MEM_CHUNKS)

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb_subr.c,v 1.177 2010/11/03 22:34:24 dyoung Exp $ */
/* $NetBSD: usb_subr.c,v 1.178 2011/03/20 17:38:11 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
/*
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.177 2010/11/03 22:34:24 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.178 2011/03/20 17:38:11 tsutsui Exp $");
#include "opt_compat_netbsd.h"
#include "opt_usbverbose.h"
@ -68,6 +68,10 @@ extern int usbdebug;
#define DPRINTFN(n,x)
#endif
MALLOC_DEFINE(M_USB, "USB", "USB misc. memory");
MALLOC_DEFINE(M_USBDEV, "USB device", "USB device driver");
MALLOC_DEFINE(M_USBHC, "USB HC", "USB host controller");
Static usbd_status usbd_set_config(usbd_device_handle, int);
Static void usbd_devinfo(usbd_device_handle, int, char *, size_t);
Static void usbd_devinfo_vp(usbd_device_handle, char *, size_t, char *, size_t,