NBPG -> PAGE_SIZE
This commit is contained in:
parent
60f33f91c2
commit
cfe0892ed3
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: iop.c,v 1.3 2000/11/09 17:20:24 itojun Exp $ */
|
||||
/* $NetBSD: iop.c,v 1.4 2000/11/14 18:48:14 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -53,6 +53,8 @@
|
|||
#include <sys/endian.h>
|
||||
#include <sys/pool.h>
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
|
||||
#include <dev/i2o/i2o.h>
|
||||
|
@ -508,7 +510,7 @@ iop_alloc_dmamem(struct iop_softc *sc, int size, bus_dmamap_t *dmamap,
|
|||
int rseg, rv;
|
||||
bus_dma_segment_t seg;
|
||||
|
||||
if ((rv = bus_dmamem_alloc(sc->sc_dmat, size, NBPG, 0,
|
||||
if ((rv = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0,
|
||||
&seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) {
|
||||
printf("%s: dmamem_alloc = %d\n", sc->sc_dv.dv_xname, rv);
|
||||
return (rv);
|
||||
|
@ -556,7 +558,7 @@ iop_ofifo_init(struct iop_softc *sc)
|
|||
mb->msgfunc = I2O_MSGFUNC(I2O_TID_IOP, I2O_EXEC_OUTBOUND_INIT);
|
||||
mb->msgictx = IOP_ICTX;
|
||||
mb->msgtctx = im->im_tctx;
|
||||
mb->pagesize = NBPG;
|
||||
mb->pagesize = PAGE_SIZE;
|
||||
mb->flags = 0x80 | ((IOP_MAX_MSG_SIZE >> 2) << 16);
|
||||
|
||||
status = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_le_isapnp.c,v 1.17 1999/03/22 10:00:11 mycroft Exp $ */
|
||||
/* $NetBSD: if_le_isapnp.c,v 1.18 2000/11/14 18:46:36 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -81,6 +81,8 @@
|
|||
#include <sys/select.h>
|
||||
#include <sys/device.h>
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_dl.h>
|
||||
#include <net/if_ether.h>
|
||||
|
@ -212,7 +214,7 @@ le_isapnp_attach(parent, self, aux)
|
|||
/*
|
||||
* Allocate a DMA area for the card.
|
||||
*/
|
||||
if (bus_dmamem_alloc(dmat, LE_ISAPNP_MEMSIZE, NBPG, 0, &seg, 1,
|
||||
if (bus_dmamem_alloc(dmat, LE_ISAPNP_MEMSIZE, PAGE_SIZE, 0, &seg, 1,
|
||||
&rseg, BUS_DMA_NOWAIT)) {
|
||||
printf("%s: couldn't allocate memory for card\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: auvia.c,v 1.5 2000/09/01 00:02:04 jdolecek Exp $ */
|
||||
/* $NetBSD: auvia.c,v 1.6 2000/11/14 18:42:55 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -52,6 +52,8 @@
|
|||
#include <sys/device.h>
|
||||
#include <sys/audioio.h>
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <dev/pci/pcidevs.h>
|
||||
#include <dev/pci/pcivar.h>
|
||||
|
||||
|
@ -700,8 +702,8 @@ auvia_malloc(void *addr, int direction, size_t size, int pool, int flags)
|
|||
return 0;
|
||||
|
||||
p->size = size;
|
||||
if ((error = bus_dmamem_alloc(sc->sc_dmat, size, NBPG, 0, &p->seg, 1,
|
||||
&rseg, BUS_DMA_NOWAIT)) != 0) {
|
||||
if ((error = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &p->seg,
|
||||
1, &rseg, BUS_DMA_NOWAIT)) != 0) {
|
||||
printf("%s: unable to allocate dma, error = %d\n",
|
||||
sc->sc_dev.dv_xname, error);
|
||||
goto fail_alloc;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fms.c,v 1.6 2000/06/26 04:56:24 simonb Exp $ */
|
||||
/* $NetBSD: fms.c,v 1.7 2000/11/14 18:42:55 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -47,6 +47,8 @@
|
|||
#include <sys/device.h>
|
||||
#include <sys/audioio.h>
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <machine/cpu.h>
|
||||
|
||||
|
@ -763,8 +765,8 @@ fms_malloc(addr, direction, size, pool, flags)
|
|||
return 0;
|
||||
|
||||
p->size = size;
|
||||
if ((error = bus_dmamem_alloc(sc->sc_dmat, size, NBPG, 0, &p->seg, 1,
|
||||
&rseg, BUS_DMA_NOWAIT)) != 0) {
|
||||
if ((error = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &p->seg,
|
||||
1, &rseg, BUS_DMA_NOWAIT)) != 0) {
|
||||
printf("%s: unable to allocate dma, error = %d\n",
|
||||
sc->sc_dev.dv_xname, error);
|
||||
goto fail_alloc;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_de.c,v 1.93 2000/09/28 10:29:42 tsutsui Exp $ */
|
||||
/* $NetBSD: if_de.c,v 1.94 2000/11/14 18:42:55 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
|
||||
|
@ -4464,7 +4464,7 @@ tulip_txput(
|
|||
do {
|
||||
int len = m0->m_len;
|
||||
caddr_t addr = mtod(m0, caddr_t);
|
||||
unsigned clsize = NBPG - (((u_long) addr) & PGOFSET);
|
||||
unsigned clsize = PAGE_SIZE - (((u_long) addr) & PAGE_MASK);
|
||||
|
||||
while (len > 0) {
|
||||
unsigned slen = min(len, clsize);
|
||||
|
@ -4526,7 +4526,7 @@ tulip_txput(
|
|||
if (partial)
|
||||
continue;
|
||||
#endif
|
||||
clsize = NBPG;
|
||||
clsize = PAGE_SIZE;
|
||||
}
|
||||
} while ((m0 = m0->m_next) != NULL);
|
||||
#endif /* TULIP_BUS_DMA */
|
||||
|
@ -5175,7 +5175,7 @@ tulip_busdma_allocmem(
|
|||
{
|
||||
bus_dma_segment_t segs[1];
|
||||
int nsegs, error;
|
||||
error = bus_dmamem_alloc(sc->tulip_dmatag, size, 1, NBPG,
|
||||
error = bus_dmamem_alloc(sc->tulip_dmatag, size, 1, PAGE_SIZE,
|
||||
segs, sizeof(segs)/sizeof(segs[0]),
|
||||
&nsegs, BUS_DMA_NOWAIT);
|
||||
if (error == 0) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_le_pci.c,v 1.28 2000/06/28 16:08:44 mrg Exp $ */
|
||||
/* $NetBSD: if_le_pci.c,v 1.29 2000/11/14 18:42:56 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -85,6 +85,8 @@
|
|||
#include <sys/socket.h>
|
||||
#include <sys/device.h>
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_ether.h>
|
||||
#include <net/if_media.h>
|
||||
|
@ -309,7 +311,7 @@ le_pci_attach(parent, self, aux)
|
|||
/*
|
||||
* Allocate a DMA area for the card.
|
||||
*/
|
||||
if (bus_dmamem_alloc(dmat, LE_PCI_MEMSIZE, NBPG, 0, &seg, 1,
|
||||
if (bus_dmamem_alloc(dmat, LE_PCI_MEMSIZE, PAGE_SIZE, 0, &seg, 1,
|
||||
&rseg, BUS_DMA_NOWAIT)) {
|
||||
printf("%s: couldn't allocate memory for card\n",
|
||||
sc->sc_dev.dv_xname);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_lmc.c,v 1.5 2000/06/28 16:08:44 mrg Exp $ */
|
||||
/* $NetBSD: if_lmc.c,v 1.6 2000/11/14 18:42:56 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-1999 LAN Media Corporation (LMC)
|
||||
|
@ -948,7 +948,7 @@ lmc_txput(lmc_softc_t * const sc, struct mbuf *m)
|
|||
do {
|
||||
int len = m0->m_len;
|
||||
caddr_t addr = mtod(m0, caddr_t);
|
||||
unsigned clsize = NBPG - (((u_long) addr) & PGOFSET);
|
||||
unsigned clsize = PAGE_SIZE - (((u_long) addr) & PAGE_MASK);
|
||||
|
||||
while (len > 0) {
|
||||
unsigned slen = min(len, clsize);
|
||||
|
@ -1013,7 +1013,7 @@ lmc_txput(lmc_softc_t * const sc, struct mbuf *m)
|
|||
if (partial)
|
||||
continue;
|
||||
#endif
|
||||
clsize = NBPG;
|
||||
clsize = PAGE_SIZE;
|
||||
}
|
||||
} while ((m0 = m0->m_next) != NULL);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ti.c,v 1.12 2000/11/12 18:32:43 bouyer Exp $ */
|
||||
/* $NetBSD: if_ti.c,v 1.13 2000/11/14 18:42:57 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998, 1999
|
||||
|
@ -95,6 +95,8 @@
|
|||
#include <sys/device.h>
|
||||
#include <sys/reboot.h>
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/if_ether.h>
|
||||
|
@ -587,7 +589,7 @@ static int ti_alloc_jumbo_mem(sc)
|
|||
|
||||
/* Grab a big chunk o' storage. */
|
||||
if ((error = bus_dmamem_alloc(sc->sc_dmat,
|
||||
TI_JMEM, NBPG, 0, &dmaseg, 1, &dmanseg,
|
||||
TI_JMEM, PAGE_SIZE, 0, &dmaseg, 1, &dmanseg,
|
||||
BUS_DMA_NOWAIT)) != 0) {
|
||||
printf("%s: can't allocate jumbo buffer, error = %d\n",
|
||||
sc->sc_dev.dv_xname, error);
|
||||
|
@ -1743,7 +1745,7 @@ static void ti_attach(parent, self, aux)
|
|||
|
||||
/* Allocate the general information block and ring buffers. */
|
||||
if ((error = bus_dmamem_alloc(sc->sc_dmat,
|
||||
sizeof(struct ti_ring_data), NBPG, 0, &dmaseg, 1, &dmanseg,
|
||||
sizeof(struct ti_ring_data), PAGE_SIZE, 0, &dmaseg, 1, &dmanseg,
|
||||
BUS_DMA_NOWAIT)) != 0) {
|
||||
printf("%s: can't allocate ring buffer, error = %d\n",
|
||||
sc->sc_dev.dv_xname, error);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_tireg.h,v 1.1 1999/09/01 11:47:46 drochner Exp $ */
|
||||
/* $NetBSD: if_tireg.h,v 1.2 2000/11/14 18:42:57 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997, 1998, 1999
|
||||
|
@ -997,7 +997,7 @@ struct ti_event_desc {
|
|||
#define TI_JRAWLEN (TI_JUMBO_FRAMELEN + ETHER_ALIGN + sizeof(u_int64_t))
|
||||
#define TI_JLEN (TI_JRAWLEN + (sizeof(u_int64_t) - \
|
||||
(TI_JRAWLEN % sizeof(u_int64_t))))
|
||||
#define TI_JPAGESZ NBPG
|
||||
#define TI_JPAGESZ PAGE_SIZE
|
||||
#define TI_RESID (TI_JPAGESZ - (TI_JLEN * TI_JSLOTS) % TI_JPAGESZ)
|
||||
#define TI_JMEM ((TI_JLEN * TI_JSLOTS) + TI_RESID)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: isp_pci.c,v 1.58 2000/10/17 17:39:10 mjacob Exp $ */
|
||||
/* $NetBSD: isp_pci.c,v 1.59 2000/11/14 18:42:57 thorpej Exp $ */
|
||||
/*
|
||||
* This driver, which is contained in NetBSD in the files:
|
||||
*
|
||||
|
@ -747,7 +747,7 @@ isp_pci_mbxdma(isp)
|
|||
return (1);
|
||||
}
|
||||
for (i = 0; i < isp->isp_maxcmds; i++) {
|
||||
if (bus_dmamap_create(dmat, MAXPHYS, (MAXPHYS / NBPG) + 1,
|
||||
if (bus_dmamap_create(dmat, MAXPHYS, (MAXPHYS / PAGE_SIZE) + 1,
|
||||
MAXPHYS, 0, BUS_DMA_NOWAIT, &pcs->pci_xfer_dmap[i])) {
|
||||
isp_prt(isp, ISP_LOGERR, "cannot create dma maps");
|
||||
break;
|
||||
|
@ -768,7 +768,8 @@ isp_pci_mbxdma(isp)
|
|||
* Allocate and map the request queue.
|
||||
*/
|
||||
len = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp));
|
||||
if (bus_dmamem_alloc(dmat, len, NBPG, 0, &sg, 1, &rs, BUS_DMA_NOWAIT) ||
|
||||
if (bus_dmamem_alloc(dmat, len, PAGE_SIZE, 0, &sg, 1, &rs,
|
||||
BUS_DMA_NOWAIT) ||
|
||||
bus_dmamem_map(pcs->pci_dmat, &sg, rs, len,
|
||||
(caddr_t *)&isp->isp_rquest, BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) {
|
||||
goto dmafail;
|
||||
|
@ -787,7 +788,8 @@ isp_pci_mbxdma(isp)
|
|||
* Allocate and map the result queue.
|
||||
*/
|
||||
len = ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp));
|
||||
if (bus_dmamem_alloc(dmat, len, NBPG, 0, &sg, 1, &rs, BUS_DMA_NOWAIT) ||
|
||||
if (bus_dmamem_alloc(dmat, len, PAGE_SIZE, 0, &sg, 1, &rs,
|
||||
BUS_DMA_NOWAIT) ||
|
||||
bus_dmamem_map(dmat, &sg, rs, len, (caddr_t *)&isp->isp_result,
|
||||
BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) {
|
||||
goto dmafail;
|
||||
|
@ -806,7 +808,8 @@ isp_pci_mbxdma(isp)
|
|||
|
||||
fcp = isp->isp_param;
|
||||
len = ISP2100_SCRLEN;
|
||||
if (bus_dmamem_alloc(dmat, len, NBPG, 0, &sg, 1, &rs, BUS_DMA_NOWAIT) ||
|
||||
if (bus_dmamem_alloc(dmat, len, PAGE_SIZE, 0, &sg, 1, &rs,
|
||||
BUS_DMA_NOWAIT) ||
|
||||
bus_dmamem_map(dmat, &sg, rs, len, (caddr_t *)&fcp->isp_scratch,
|
||||
BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) {
|
||||
goto dmafail;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pciide.c,v 1.91 2000/11/08 18:22:27 matt Exp $ */
|
||||
/* $NetBSD: pciide.c,v 1.92 2000/11/14 18:42:58 thorpej Exp $ */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -96,6 +96,8 @@ int wdcdebug_pciide_mask = 0;
|
|||
#include <sys/device.h>
|
||||
#include <sys/malloc.h>
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <machine/endian.h>
|
||||
|
||||
#include <dev/pci/pcireg.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pciidereg.h,v 1.5 2000/03/09 20:26:31 soren Exp $ */
|
||||
/* $NetBSD: pciidereg.h,v 1.6 2000/11/14 18:42:58 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
|
||||
|
@ -113,4 +113,4 @@ struct idedma_table {
|
|||
#define IDEDMA_BYTE_COUNT_ALIGN 0x00010000
|
||||
|
||||
/* Number of idedma table needed */
|
||||
#define NIDEDMA_TABLES (MAXPHYS/NBPG + 1)
|
||||
#define NIDEDMA_TABLES (MAXPHYS/PAGE_SIZE + 1)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pcscp.c,v 1.10 2000/06/05 15:08:00 tsutsui Exp $ */
|
||||
/* $NetBSD: pcscp.c,v 1.11 2000/11/14 18:42:58 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -54,6 +54,8 @@
|
|||
#include <machine/intr.h>
|
||||
#include <machine/endian.h>
|
||||
|
||||
#include <uvm/uvm_extern.h>
|
||||
|
||||
#include <dev/scsipi/scsi_all.h>
|
||||
#include <dev/scsipi/scsipi_all.h>
|
||||
#include <dev/scsipi/scsiconf.h>
|
||||
|
@ -298,7 +300,7 @@ pcscp_attach(parent, self, aux)
|
|||
*/
|
||||
|
||||
if ((error = bus_dmamem_alloc(esc->sc_dmat,
|
||||
sizeof(u_int32_t) * MDL_SIZE, NBPG, 0, &seg, 1, &rseg,
|
||||
sizeof(u_int32_t) * MDL_SIZE, PAGE_SIZE, 0, &seg, 1, &rseg,
|
||||
BUS_DMA_NOWAIT)) != 0) {
|
||||
printf("%s: unable to allocate memory for the MDL, "
|
||||
"error = %d\n", sc->sc_dev.dv_xname, error);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: twe.c,v 1.3 2000/11/08 19:23:50 ad Exp $ */
|
||||
/* $NetBSD: twe.c,v 1.4 2000/11/14 18:42:58 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -222,7 +222,7 @@ twe_attach(struct device *parent, struct device *self, void *aux)
|
|||
*/
|
||||
size = sizeof(struct twe_cmd) * TWE_REAL_MAX_QUEUECNT;
|
||||
|
||||
if ((rv = bus_dmamem_alloc(sc->sc_dmat, size, NBPG, 0, &seg, 1,
|
||||
if ((rv = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &seg, 1,
|
||||
&rseg, BUS_DMA_NOWAIT)) != 0) {
|
||||
printf("%s: unable to allocate commands, rv = %d\n",
|
||||
sc->sc_dv.dv_xname, rv);
|
||||
|
@ -268,7 +268,8 @@ twe_attach(struct device *parent, struct device *self, void *aux)
|
|||
ccb->ccb_cmdid = i;
|
||||
ccb->ccb_flags = 0;
|
||||
rv = bus_dmamap_create(sc->sc_dmat, TWE_MAX_XFER,
|
||||
TWE_MAX_SEGS, NBPG, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
|
||||
TWE_MAX_SEGS, PAGE_SIZE, 0,
|
||||
BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW,
|
||||
&ccb->ccb_dmamap_xfer);
|
||||
if (rv != 0)
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: twereg.h,v 1.3 2000/11/08 19:23:50 ad Exp $ */
|
||||
/* $NetBSD: twereg.h,v 1.4 2000/11/14 18:42:59 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -147,7 +147,7 @@
|
|||
#define TWE_SECTOR_SIZE 512
|
||||
|
||||
/* Maximum transfer size. XXX This is an arbitrarily chosen value. */
|
||||
#define TWE_MAX_XFER (TWE_SG_SIZE * NBPG)
|
||||
#define TWE_MAX_XFER (TWE_SG_SIZE * PAGE_SIZE)
|
||||
|
||||
/* Scatter/gather block. */
|
||||
struct twe_sgb {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: twevar.h,v 1.3 2000/11/08 19:23:50 ad Exp $ */
|
||||
/* $NetBSD: twevar.h,v 1.4 2000/11/14 18:42:59 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -84,6 +84,7 @@
|
|||
#define TWE_MAX_PU_QUEUECNT 32 /* Maximum per-unit queue count */
|
||||
#endif
|
||||
|
||||
/* XXX NBPG */
|
||||
#if TWE_SG_SIZE > (((MAXPHYS + NBPG - 1) / NBPG) + 1)
|
||||
#define TWE_MAX_SEGS (((MAXPHYS + NBPG - 1) / NBPG) + 1)
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue