summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2003-02-01 06:23:35 +0000
committerthorpej <thorpej@NetBSD.org>2003-02-01 06:23:35 +0000
commitb193480908a4b566cc9fdb05a1453a40e8a125a1 (patch)
tree64be834e331a3dc3f03d186d0cfd6daa45a60c7a /sys/dev/raidframe
parente2c139ba9fd472fb9a024f07f4865162f3670bc9 (diff)
Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around, instead of an int constant. Allow the limit to be adjusted when the malloc type is defined, or with a function call, as suggested by Jonathan Stone.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/raidframevar.h7
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c9
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/raidframe/raidframevar.h b/sys/dev/raidframe/raidframevar.h
index ebd80a35463..06937fd2237 100644
--- a/sys/dev/raidframe/raidframevar.h
+++ b/sys/dev/raidframe/raidframevar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: raidframevar.h,v 1.1 2001/10/04 15:43:58 oster Exp $ */
+/* $NetBSD: raidframevar.h,v 1.2 2003/02/01 06:23:40 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -111,6 +111,8 @@
#include <sys/proc.h>
#include <sys/lock.h>
+#include <sys/mallocvar.h>
+
/*
* First, define system-dependent types and constants.
*
@@ -161,6 +163,9 @@ typedef u_int64_t RF_uint64;
#define RF_TRUE 1
#define RF_FALSE 0
+/* Malloc types. */
+MALLOC_DECLARE(M_RAIDFRAME);
+
/*
* Now, some generic types
*/
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index fb59a593cdd..a4ab55c2959 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.152 2003/01/19 16:52:55 thorpej Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.153 2003/02/01 06:23:40 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -77,9 +77,6 @@
* @(#)cd.c 8.2 (Berkeley) 11/16/93
*/
-
-
-
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -114,7 +111,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.152 2003/01/19 16:52:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.153 2003/02/01 06:23:40 thorpej Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -170,6 +167,8 @@ static RF_SparetWait_t *rf_sparet_wait_queue; /* requests to install a
static RF_SparetWait_t *rf_sparet_resp_queue; /* responses from
* installation process */
+MALLOC_DEFINE(M_RAIDFRAME, "RAIDframe", "RAIDframe structures");
+
/* prototypes */
static void KernelWakeupFunc(struct buf * bp);
static void InitBP(struct buf * bp, struct vnode *, unsigned rw_flag,