Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/marvell Use PAGE_SIZE rather than NBPG.
details: https://anonhg.NetBSD.org/src/rev/1ae3735b35e3
branches: trunk
changeset: 545445:1ae3735b35e3
user: thorpej <thorpej%NetBSD.org@localhost>
date: Tue Apr 08 22:33:33 2003 +0000
description:
Use PAGE_SIZE rather than NBPG.
diffstat:
sys/dev/marvell/gtidma.c | 10 +++++-----
sys/dev/marvell/gtmpsc.c | 29 ++++++++++++++++++-----------
sys/dev/marvell/if_gfe.c | 6 ++++--
3 files changed, 27 insertions(+), 18 deletions(-)
diffs (150 lines):
diff -r 2fbab0faef94 -r 1ae3735b35e3 sys/dev/marvell/gtidma.c
--- a/sys/dev/marvell/gtidma.c Tue Apr 08 21:56:31 2003 +0000
+++ b/sys/dev/marvell/gtidma.c Tue Apr 08 22:33:33 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gtidma.c,v 1.1 2003/03/05 22:08:20 matt Exp $ */
+/* $NetBSD: gtidma.c,v 1.2 2003/04/08 22:33:33 thorpej Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -47,14 +47,14 @@
#include "opt_ddb.h"
#include "opt_allegro.h"
-#include <sys/types.h>
-#include <sys/cdefs.h>
+#include <sys/param.h>
#include <sys/device.h>
#include <sys/inttypes.h>
#include <sys/callout.h>
#include <sys/malloc.h>
-#include <machine/param.h>
+#include <uvm/uvm_extern.h>
+
#include <machine/psl.h>
#include <machine/intr.h>
#include <machine/bus.h>
@@ -579,7 +579,7 @@
idmp->idm_size = sz;
idmp->idm_maxsegs = maxsegs;
- error = bus_dmamem_alloc(sc->idma_dmatag, idmp->idm_size, NBPG,
+ error = bus_dmamem_alloc(sc->idma_dmatag, idmp->idm_size, PAGE_SIZE,
IDMA_BOUNDARY, idmp->idm_segs, idmp->idm_maxsegs,
&idmp->idm_nsegs, BUS_DMA_NOWAIT);
if (error) {
diff -r 2fbab0faef94 -r 1ae3735b35e3 sys/dev/marvell/gtmpsc.c
--- a/sys/dev/marvell/gtmpsc.c Tue Apr 08 21:56:31 2003 +0000
+++ b/sys/dev/marvell/gtmpsc.c Tue Apr 08 22:33:33 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gtmpsc.c,v 1.5 2003/03/24 20:03:23 matt Exp $ */
+/* $NetBSD: gtmpsc.c,v 1.6 2003/04/08 22:33:33 thorpej Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -58,6 +58,9 @@
#include <sys/kernel.h>
#include <sys/kgdb.h>
#endif
+
+#include <uvm/uvm_extern.h>
+
#include <powerpc/atomic.h>
#include <dev/cons.h>
#include <machine/bus.h>
@@ -208,11 +211,15 @@
/*
* hacks for console initialization
* which happens prior to autoconfig "attach"
+ *
+ * XXX Assumes PAGE_SIZE is a constant!
*/
STATIC unsigned int gtmpsccninit_done = 0;
STATIC gtmpsc_softc_t gtmpsc_fake_softc;
-STATIC unsigned char gtmpsc_earlybuf[NBPG] __attribute__ ((aligned(NBPG)));
-STATIC unsigned char gtmpsc_fake_dmapage[NBPG] __attribute__ ((aligned(NBPG)));
+STATIC unsigned char gtmpsc_earlybuf[PAGE_SIZE]
+ __attribute__ ((aligned(PAGE_SIZE)));
+STATIC unsigned char gtmpsc_fake_dmapage[PAGE_SIZE]
+ __attribute__ ((aligned(PAGE_SIZE)));
#define GTMPSC_PRINT_BUF_SIZE 4096
@@ -444,7 +451,7 @@
sc->gtmpsc_unit = ga->ga_unit;
aprint_normal(": SDMA");
- err = bus_dmamem_alloc(sc->gtmpsc_dmat, NBPG, NBPG, NBPG,
+ err = bus_dmamem_alloc(sc->gtmpsc_dmat, PAGE_SIZE, PAGE_SIZE, PAGE_SIZE,
sc->gtmpsc_dma_segs, 1, &rsegs, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW);
if (err) {
PRINTF(("mpscattach: bus_dmamem_alloc error 0x%x\n", err));
@@ -452,10 +459,10 @@
return;
}
#ifndef SDMA_COHERENT
- err = bus_dmamem_map(sc->gtmpsc_dmat, sc->gtmpsc_dma_segs, 1, NBPG,
+ err = bus_dmamem_map(sc->gtmpsc_dmat, sc->gtmpsc_dma_segs, 1, PAGE_SIZE,
&kva, BUS_DMA_NOWAIT);
#else
- err = bus_dmamem_map(sc->gtmpsc_dmat, sc->gtmpsc_dma_segs, 1, NBPG,
+ err = bus_dmamem_map(sc->gtmpsc_dmat, sc->gtmpsc_dma_segs, 1, PAGE_SIZE,
&kva, BUS_DMA_NOWAIT|BUS_DMA_NOCACHE);
#endif
if (err) {
@@ -464,22 +471,22 @@
return;
}
- err = bus_dmamap_create(sc->gtmpsc_dmat, NBPG, 1, NBPG, NBPG,
- BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, &sc->gtmpsc_dma_map);
+ err = bus_dmamap_create(sc->gtmpsc_dmat, PAGE_SIZE, 1, PAGE_SIZE,
+ PAGE_SIZE, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, &sc->gtmpsc_dma_map);
if (err) {
PRINTF(("mpscattach: bus_dmamap_create error 0x%x\n", err));
splx(s);
return;
}
- err = bus_dmamap_load(sc->gtmpsc_dmat, sc->gtmpsc_dma_map, kva, NBPG,
- NULL, 0);
+ err = bus_dmamap_load(sc->gtmpsc_dmat, sc->gtmpsc_dma_map, kva,
+ PAGE_SIZE, NULL, 0);
if (err) {
PRINTF(("mpscattach: bus_dmamap_load error 0x%x\n", err));
splx(s);
return;
}
- memset(kva, 0, NBPG); /* paranoid/superfluous */
+ memset(kva, 0, PAGE_SIZE); /* paranoid/superfluous */
vmps = (gtmpsc_poll_sdma_t *)kva; /* KVA */
pmps = (gtmpsc_poll_sdma_t *)sc->gtmpsc_dma_map->dm_segs[0].ds_addr; /* PA */
diff -r 2fbab0faef94 -r 1ae3735b35e3 sys/dev/marvell/if_gfe.c
--- a/sys/dev/marvell/if_gfe.c Tue Apr 08 21:56:31 2003 +0000
+++ b/sys/dev/marvell/if_gfe.c Tue Apr 08 22:33:33 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_gfe.c,v 1.6 2003/04/08 19:37:17 matt Exp $ */
+/* $NetBSD: if_gfe.c,v 1.7 2003/04/08 22:33:34 thorpej Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -49,6 +49,8 @@
#include <sys/inttypes.h>
#include <sys/queue.h>
+#include <uvm/uvm_extern.h>
+
#include <sys/callout.h>
#include <sys/device.h>
#include <sys/errno.h>
@@ -347,7 +349,7 @@
flags |= BUS_DMA_NOCACHE;
#endif
- error = bus_dmamem_alloc(sc->sc_dmat, gdm->gdm_size, NBPG,
+ error = bus_dmamem_alloc(sc->sc_dmat, gdm->gdm_size, PAGE_SIZE,
gdm->gdm_size, gdm->gdm_segs, gdm->gdm_maxsegs, &gdm->gdm_nsegs,
BUS_DMA_NOWAIT);
if (error)
Home |
Main Index |
Thread Index |
Old Index