summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>1999-01-14 22:49:05 +0000
committerthorpej <thorpej@NetBSD.org>1999-01-14 22:49:05 +0000
commitd8f3aefec7970eb4bbd5c62f5dddd576270854aa (patch)
treefbade9ca357acb61b91510ce44cff0620209f8dd /sys/dev/raidframe
parent6348b7d5b5fa83160013acd8f58e930f83c53f03 (diff)
Use M_RAIDFRAME.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_debugMem.h12
-rw-r--r--sys/dev/raidframe/rf_diskqueue.c6
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c6
-rw-r--r--sys/dev/raidframe/rf_shutdown.c13
4 files changed, 28 insertions, 9 deletions
diff --git a/sys/dev/raidframe/rf_debugMem.h b/sys/dev/raidframe/rf_debugMem.h
index 7ff600634dd..f7b35152f7f 100644
--- a/sys/dev/raidframe/rf_debugMem.h
+++ b/sys/dev/raidframe/rf_debugMem.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_debugMem.h,v 1.1 1998/11/13 04:20:28 oster Exp $ */
+/* $NetBSD: rf_debugMem.h,v 1.2 1999/01/14 22:49:05 thorpej Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -198,7 +198,7 @@ typedef u_int32_t U32;
#define RF_Malloc(_p_, _size_, _cast_) \
{ \
- _p_ = _cast_ malloc((u_long)_size_, M_DEVBUF, M_WAITOK); \
+ _p_ = _cast_ malloc((u_long)_size_, M_RAIDFRAME, M_WAITOK); \
bzero((char *)_p_, _size_); \
if (rf_memDebug) rf_record_malloc(_p_, _size_, __LINE__, __FILE__); \
}
@@ -231,11 +231,19 @@ typedef u_int32_t U32;
if (__alist) rf_AddToAllocList(__alist, __p, (__nel)*(__elsz)); \
}
+#ifdef __NetBSD__
+#define RF_Free(_p_, _sz_) \
+ { \
+ free((void *)(_p_), M_RAIDFRAME); \
+ if (rf_memDebug) rf_unrecord_malloc(_p_, (U32) (_sz_)); \
+ }
+#else
#define RF_Free(_p_, _sz_) \
{ \
free((void *)(_p_), M_DEVBUF); \
if (rf_memDebug) rf_unrecord_malloc(_p_, (U32) (_sz_)); \
}
+#endif /* __NetBSD__ */
#endif /* KERNEL */
diff --git a/sys/dev/raidframe/rf_diskqueue.c b/sys/dev/raidframe/rf_diskqueue.c
index 3a1e74cb8cb..1788708c796 100644
--- a/sys/dev/raidframe/rf_diskqueue.c
+++ b/sys/dev/raidframe/rf_diskqueue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_diskqueue.c,v 1.3 1999/01/14 20:29:38 oster Exp $ */
+/* $NetBSD: rf_diskqueue.c,v 1.4 1999/01/14 22:49:05 thorpej Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -350,7 +350,7 @@ static int init_dqd(dqd)
#ifdef KERNEL
#ifdef __NetBSD__
/* XXX not sure if the following malloc is appropriate... probably not quite... */
- dqd->bp = (struct buf *) malloc( sizeof(struct buf), M_DEVBUF, M_NOWAIT);
+ dqd->bp = (struct buf *) malloc( sizeof(struct buf), M_RAIDFRAME, M_NOWAIT);
/* XXX */
/* printf("NEED TO IMPLEMENT THIS BETTER!\n"); */
#else
@@ -373,7 +373,7 @@ static void clean_dqd(dqd)
#ifdef __NetBSD__
/* printf("NEED TO IMPLEMENT THIS BETTER(2)!\n"); */
/* XXX ? */
- free( dqd->bp, M_DEVBUF );
+ free( dqd->bp, M_RAIDFRAME );
#else
ubc_buffree(dqd->bp);
#endif
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index ed0188354b4..63b7bb70a7b 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.5 1998/12/22 20:03:14 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.6 1999/01/14 22:49:05 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -514,7 +514,7 @@ raidattach(num)
raid_softc = (struct raid_softc *)
malloc(num * sizeof(struct raid_softc),
- M_DEVBUF, M_NOWAIT);
+ M_RAIDFRAME, M_NOWAIT);
if (raid_softc == NULL) {
printf("WARNING: no memory for RAIDframe driver\n");
return;
@@ -1340,7 +1340,7 @@ raidinit(dev, raidPtr,unit)
rs = &raid_softc[unit];
pool_init(&rs->sc_cbufpool, sizeof(struct raidbuf), 0,
- 0, 0, "raidpl", 0, NULL, NULL, M_DEVBUF);
+ 0, 0, "raidpl", 0, NULL, NULL, M_RAIDFRAME);
/* XXX should check return code first... */
diff --git a/sys/dev/raidframe/rf_shutdown.c b/sys/dev/raidframe/rf_shutdown.c
index c12277266a0..df002a9fcc7 100644
--- a/sys/dev/raidframe/rf_shutdown.c
+++ b/sys/dev/raidframe/rf_shutdown.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_shutdown.c,v 1.1 1998/11/13 04:20:34 oster Exp $ */
+/* $NetBSD: rf_shutdown.c,v 1.2 1999/01/14 22:49:05 thorpej Exp $ */
/*
* rf_shutdown.c
*/
@@ -43,7 +43,11 @@
static void rf_FreeShutdownEnt(RF_ShutdownList_t *ent)
{
#ifdef KERNEL
+#ifdef __NetBSD__
+ FREE(ent, M_RAIDFRAME);
+#else
FREE(ent, M_DEVBUF);
+#endif /* __NetBSD__ */
#else /* KERNEL */
free(ent);
#endif /* KERNEL */
@@ -63,10 +67,17 @@ int _rf_ShutdownCreate(
* and shutdown after RAIDframe internal allocation system.
*/
#ifdef KERNEL
+#ifdef __NetBSD__
+ ent = (RF_ShutdownList_t *)malloc( sizeof(RF_ShutdownList_t), M_RAIDFRAME, M_WAITOK);
+#if 0
+ MALLOC(ent, RF_ShutdownList_t *, sizeof(RF_ShutdownList_t), M_RAIDFRAME, M_WAITOK);
+#endif
+#else
ent = (RF_ShutdownList_t *)malloc( sizeof(RF_ShutdownList_t), M_DEVBUF, M_WAITOK);
#if 0
MALLOC(ent, RF_ShutdownList_t *, sizeof(RF_ShutdownList_t), M_DEVBUF, M_WAITOK);
#endif
+#endif /* __NetBSD__ */
#else /* KERNEL */
ent = (RF_ShutdownList_t *)malloc(sizeof(RF_ShutdownList_t));
#endif /* KERNEL */