Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ieee1394 Change to consistently use M_FW for all mal...
details: https://anonhg.NetBSD.org/src/rev/d3b50aa1e569
branches: trunk
changeset: 779063:d3b50aa1e569
user: dsl <dsl%NetBSD.org@localhost>
date: Sun Apr 29 18:31:40 2012 +0000
description:
Change to consistently use M_FW for all malloc/free.
It probably doesn't matter any more, but the code doesn't appear to
have matched its mallocs and frees - so the stats would have been awol.
diffstat:
sys/dev/ieee1394/firewire.c | 11 +++++------
sys/dev/ieee1394/firewirereg.h | 3 +--
sys/dev/ieee1394/fwdev.c | 10 +++++-----
sys/dev/ieee1394/fwmem.c | 12 +++++-------
sys/dev/ieee1394/fwohcivar.h | 4 +---
sys/dev/ieee1394/if_fwip.c | 13 ++++++-------
6 files changed, 23 insertions(+), 30 deletions(-)
diffs (248 lines):
diff -r 8987225a6fdd -r d3b50aa1e569 sys/dev/ieee1394/firewire.c
--- a/sys/dev/ieee1394/firewire.c Sun Apr 29 16:36:53 2012 +0000
+++ b/sys/dev/ieee1394/firewire.c Sun Apr 29 18:31:40 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: firewire.c,v 1.38 2010/09/07 07:26:54 cegger Exp $ */
+/* $NetBSD: firewire.c,v 1.39 2012/04/29 18:31:40 dsl Exp $ */
/*-
* Copyright (c) 2003 Hidetoshi Shimokawa
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.38 2010/09/07 07:26:54 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.39 2012/04/29 18:31:40 dsl Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -128,7 +128,6 @@
}
MALLOC_DEFINE(M_FW, "ieee1394", "IEEE1394");
-MALLOC_DEFINE(M_FWXFER, "fw_xfer", "XFER/IEEE1394");
#define FW_MAXASYRTY 4
@@ -1139,7 +1138,7 @@
"cannot respond(bus reset)!\n");
return;
}
- rb->xfer = fw_xfer_alloc(M_FWXFER);
+ rb->xfer = fw_xfer_alloc(M_FW);
if (rb->xfer == NULL)
return;
rb->xfer->send.spd = rb->spd;
@@ -1543,7 +1542,7 @@
fc->status = FWBUSPHYCONF;
- xfer = fw_xfer_alloc(M_FWXFER);
+ xfer = fw_xfer_alloc(M_FW);
if (xfer == NULL)
return;
xfer->fc = fc;
@@ -2250,7 +2249,7 @@
struct fw_pkt *fp;
int err = 0;
- xfer = fw_xfer_alloc_buf(M_FWXFER, 8, 4);
+ xfer = fw_xfer_alloc_buf(M_FW, 8, 4);
if (xfer == NULL)
return;
xfer->send.spd = 0;
diff -r 8987225a6fdd -r d3b50aa1e569 sys/dev/ieee1394/firewirereg.h
--- a/sys/dev/ieee1394/firewirereg.h Sun Apr 29 16:36:53 2012 +0000
+++ b/sys/dev/ieee1394/firewirereg.h Sun Apr 29 18:31:40 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: firewirereg.h,v 1.16 2011/04/24 18:52:26 rmind Exp $ */
+/* $NetBSD: firewirereg.h,v 1.17 2012/04/29 18:31:40 dsl Exp $ */
/*-
* Copyright (c) 2003 Hidetoshi Shimokawa
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -323,6 +323,5 @@
#include <sys/mallocvar.h>
MALLOC_DECLARE(M_FW);
-MALLOC_DECLARE(M_FWXFER);
#endif /* _FIREWIREREG_H_ */
diff -r 8987225a6fdd -r d3b50aa1e569 sys/dev/ieee1394/fwdev.c
--- a/sys/dev/ieee1394/fwdev.c Sun Apr 29 16:36:53 2012 +0000
+++ b/sys/dev/ieee1394/fwdev.c Sun Apr 29 18:31:40 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fwdev.c,v 1.26 2011/07/31 13:51:53 uebayasi Exp $ */
+/* $NetBSD: fwdev.c,v 1.27 2012/04/29 18:31:40 dsl Exp $ */
/*-
* Copyright (c) 2003 Hidetoshi Shimokawa
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.26 2011/07/31 13:51:53 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.27 2012/04/29 18:31:40 dsl Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -487,7 +487,7 @@
if ((tinfo->flag & FWTI_BLOCK_ASY) != 0)
pay_len = MAX(0, asyreq->req.len - tinfo->hdr_len);
- xfer = fw_xfer_alloc_buf(M_FWXFER, pay_len, PAGE_SIZE/*XXX*/);
+ xfer = fw_xfer_alloc_buf(M_FW, pay_len, PAGE_SIZE/*XXX*/);
if (xfer == NULL)
return ENOMEM;
@@ -594,7 +594,7 @@
STAILQ_INIT(&fwb->xferlist);
err = fw_bindadd(fc, fwb);
if (err == 0) {
- fw_xferlist_add(&fwb->xferlist, M_FWXFER,
+ fw_xferlist_add(&fwb->xferlist, M_FW,
/* XXX */
PAGE_SIZE, PAGE_SIZE, 5, fc, (void *)fwb, fw_hand);
STAILQ_INSERT_TAIL(&d->binds, fwb, chlist);
@@ -857,7 +857,7 @@
tinfo->hdr_len - sizeof(uint32_t), uio)))
return err;
- if ((xfer = fw_xfer_alloc_buf(M_FWXFER, uio->uio_resid,
+ if ((xfer = fw_xfer_alloc_buf(M_FW, uio->uio_resid,
PAGE_SIZE/*XXX*/)) == NULL)
return ENOMEM;
diff -r 8987225a6fdd -r d3b50aa1e569 sys/dev/ieee1394/fwmem.c
--- a/sys/dev/ieee1394/fwmem.c Sun Apr 29 16:36:53 2012 +0000
+++ b/sys/dev/ieee1394/fwmem.c Sun Apr 29 18:31:40 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fwmem.c,v 1.16 2011/07/31 13:51:53 uebayasi Exp $ */
+/* $NetBSD: fwmem.c,v 1.17 2012/04/29 18:31:40 dsl Exp $ */
/*-
* Copyright (c) 2002-2003
* Hidetoshi Shimokawa. All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwmem.c,v 1.16 2011/07/31 13:51:53 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwmem.c,v 1.17 2012/04/29 18:31:40 dsl Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -155,8 +155,6 @@
return sysctl_fwmem_verify(SYSCTLFN_CALL(rnode), 0, FWSPD_S400);
}
-MALLOC_DEFINE(M_FWMEM, "fwmem", "fwmem/IEEE1394");
-
#define MAXLEN (512 << fwmem_speed)
struct fwmem_softc {
@@ -187,7 +185,7 @@
} else {
sc->si_drv1 = (void *)-1;
sc->si_drv1 = malloc(sizeof(struct fwmem_softc),
- M_FWMEM, M_WAITOK);
+ M_FW, M_WAITOK);
if (sc->si_drv1 == NULL)
return ENOMEM;
fms = (struct fwmem_softc *)sc->si_drv1;
@@ -195,7 +193,7 @@
fms->sc = sc;
fms->refcount = 1;
STAILQ_INIT(&fms->xferlist);
- xfer = fw_xfer_alloc(M_FWMEM);
+ xfer = fw_xfer_alloc(M_FW);
STAILQ_INSERT_TAIL(&fms->xferlist, xfer, link);
}
if (fwmem_debug)
@@ -457,7 +455,7 @@
{
struct fw_xfer *xfer;
- xfer = fw_xfer_alloc(M_FWMEM);
+ xfer = fw_xfer_alloc(M_FW);
if (xfer == NULL)
return NULL;
diff -r 8987225a6fdd -r d3b50aa1e569 sys/dev/ieee1394/fwohcivar.h
--- a/sys/dev/ieee1394/fwohcivar.h Sun Apr 29 16:36:53 2012 +0000
+++ b/sys/dev/ieee1394/fwohcivar.h Sun Apr 29 18:31:40 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fwohcivar.h,v 1.32 2010/05/23 18:56:59 christos Exp $ */
+/* $NetBSD: fwohcivar.h,v 1.33 2012/04/29 18:31:40 dsl Exp $ */
/*-
* Copyright (c) 2003 Hidetoshi SHimokawa
@@ -39,8 +39,6 @@
#ifndef _FWOHCIVAR_H_
#define _FWOHCIVAR_H_
-MALLOC_DECLARE(M_FW);
-
struct fwohci_softc {
struct firewire_comm fc;
bus_space_tag_t bst;
diff -r 8987225a6fdd -r d3b50aa1e569 sys/dev/ieee1394/if_fwip.c
--- a/sys/dev/ieee1394/if_fwip.c Sun Apr 29 16:36:53 2012 +0000
+++ b/sys/dev/ieee1394/if_fwip.c Sun Apr 29 18:31:40 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_fwip.c,v 1.24 2010/05/23 18:56:59 christos Exp $ */
+/* $NetBSD: if_fwip.c,v 1.25 2012/04/29 18:31:40 dsl Exp $ */
/*-
* Copyright (c) 2004
* Doug Rabson
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.24 2010/05/23 18:56:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.25 2012/04/29 18:31:40 dsl Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -104,7 +104,6 @@
static int tx_speed = 2;
static int rx_queue_len = FWMAXQUEUE;
-MALLOC_DEFINE(M_FWIP, "if_fwip", "IP over IEEE1394 interface");
/*
* Setup sysctl(3) MIB, hw.fwip.*
*
@@ -362,7 +361,7 @@
xferq->buf = NULL;
xferq->bulkxfer = (struct fw_bulkxfer *) malloc(
sizeof(struct fw_bulkxfer) * xferq->bnchunk,
- M_FWIP, M_WAITOK);
+ M_FW, M_WAITOK);
if (xferq->bulkxfer == NULL) {
aprint_error_ifnet(ifp, "if_fwip: malloc failed\n");
return ENOMEM;
@@ -389,7 +388,7 @@
/* pre-allocate xfer */
STAILQ_INIT(&sc->sc_fwb.xferlist);
for (i = 0; i < rx_queue_len; i++) {
- xfer = fw_xfer_alloc(M_FWIP);
+ xfer = fw_xfer_alloc(M_FW);
if (xfer == NULL)
break;
m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR);
@@ -405,7 +404,7 @@
STAILQ_INIT(&sc->sc_xferlist);
for (i = 0; i < TX_MAX_QUEUE; i++) {
- xfer = fw_xfer_alloc(M_FWIP);
+ xfer = fw_xfer_alloc(M_FW);
if (xfer == NULL)
break;
xfer->send.spd = tx_speed;
@@ -455,7 +454,7 @@
for (i = 0; i < xferq->bnchunk; i++)
m_freem(xferq->bulkxfer[i].mbuf);
- free(xferq->bulkxfer, M_FWIP);
+ free(xferq->bulkxfer, M_FW);
fw_bindremove(fc, &sc->sc_fwb);
for (xfer = STAILQ_FIRST(&sc->sc_fwb.xferlist); xfer != NULL;
Home |
Main Index |
Thread Index |
Old Index