Use PAGE_SIZE rather than NBPG.

This commit is contained in:
thorpej 2003-04-01 02:13:53 +00:00
parent 52d8769e0b
commit 89a25a097c
6 changed files with 25 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cosc.c,v 1.10 2002/10/05 17:16:34 chs Exp $ */
/* $NetBSD: cosc.c,v 1.11 2003/04/01 02:13:53 thorpej Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
@ -45,6 +45,9 @@
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -232,7 +235,7 @@ coscattach(pdp, dp, auxp)
}
#endif
sc->sc_softc.sc_bump_sz = NBPG;
sc->sc_softc.sc_bump_sz = PAGE_SIZE;
sc->sc_softc.sc_bump_pa = 0x0;
escinitialize((struct esc_softc *)sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: csc.c,v 1.9 2002/10/05 17:16:34 chs Exp $ */
/* $NetBSD: csc.c,v 1.10 2003/04/01 02:13:53 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -44,6 +44,9 @@
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -155,7 +158,7 @@ cscattach(pdp, dp, auxp)
sc->sc_softc.sc_config_flags = SFAS_NO_DMA /*| SFAS_NF_DEBUG*/;
sc->sc_softc.sc_host_id = 7; /* Should check the jumpers */
sc->sc_softc.sc_bump_sz = NBPG;
sc->sc_softc.sc_bump_sz = PAGE_SIZE;
sc->sc_softc.sc_bump_pa = 0x0;
sfasinitialize((struct sfas_softc *)sc);

View File

@ -1,4 +1,4 @@
/* $NetBSD: esc.c,v 1.9 2002/10/05 17:16:34 chs Exp $ */
/* $NetBSD: esc.c,v 1.10 2003/04/01 02:13:53 thorpej Exp $ */
/*
* Copyright (c) 1995 Scott Stevens
@ -55,7 +55,7 @@
#include <sys/param.h>
__RCSID("$NetBSD: esc.c,v 1.9 2002/10/05 17:16:34 chs Exp $");
__RCSID("$NetBSD: esc.c,v 1.10 2003/04/01 02:13:53 thorpej Exp $");
#include <sys/systm.h>
#include <sys/device.h>
@ -223,7 +223,7 @@ escinitialize(dev)
*pte &= ~L2_C;
PTE_SYNC(pte);
cpu_tlb_flushD();
cpu_dcache_wbinv_range((vm_offset_t)dev->sc_bump_va, NBPG);
cpu_dcache_wbinv_range((vm_offset_t)dev->sc_bump_va, PAGE_SIZE);
printf(" dmabuf V0x%08x P0x%08x", (u_int)dev->sc_bump_va, (u_int)dev->sc_bump_pa);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ptsc.c,v 1.8 2002/10/05 17:16:35 chs Exp $ */
/* $NetBSD: ptsc.c,v 1.9 2003/04/01 02:13:53 thorpej Exp $ */
/*
* Copyright (c) 1995 Scott Stevens
@ -49,6 +49,9 @@
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -163,7 +166,7 @@ ptscattach(pdp, dp, auxp)
sc->sc_softc.sc_config_flags = SFAS_NO_DMA /*| SFAS_NF_DEBUG*/;
sc->sc_softc.sc_host_id = 7; /* Should check the jumpers */
sc->sc_softc.sc_bump_sz = NBPG;
sc->sc_softc.sc_bump_sz = PAGE_SIZE;
sc->sc_softc.sc_bump_pa = 0x0;
sfasinitialize((struct sfas_softc *)sc);
@ -417,7 +420,7 @@ do { chain[n].ptr = (p); chain[n].len = (l); chain[n++].flg = (f); } while(0)
lastpa = 0;
while(len > 3) {
pa = kvtop(ptr);
max_t = NBPG - (pa & PGOFSET);
max_t = PAGE_SIZE - (pa & PGOFSET);
if (max_t > len)
max_t = len;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sfas.c,v 1.8 2002/10/05 17:16:35 chs Exp $ */
/* $NetBSD: sfas.c,v 1.9 2003/04/01 02:13:53 thorpej Exp $ */
/*
* Copyright (c) 1995 Scott Stevens
@ -216,7 +216,7 @@ sfasinitialize(dev)
*pte &= ~(L2_C | L2_B);
PTE_SYNC(pte);
cpu_tlb_flushD();
cpu_dcache_wbinv_range((vm_offset_t)dev->sc_bump_va, NBPG);
cpu_dcache_wbinv_range((vm_offset_t)dev->sc_bump_va, PAGE_SIZE);
printf(" dmabuf V0x%08x P0x%08x", (u_int)dev->sc_bump_va, (u_int)dev->sc_bump_pa);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus_dma.c,v 1.6 2002/06/02 14:44:43 drochner Exp $ */
/* $NetBSD: bus_dma.c,v 1.7 2003/04/01 02:15:24 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@ -39,7 +39,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.6 2002/06/02 14:44:43 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.7 2003/04/01 02:15:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -161,7 +161,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map,
/*
* Compute the segment size, and adjust counts.
*/
sgsize = NBPG - ((u_long)vaddr & PGOFSET);
sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
if (buflen < sgsize)
sgsize = buflen;
if (map->_dm_maxsegsz < sgsize)
@ -670,7 +670,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
for (curseg = 0; curseg < nsegs; curseg++) {
for (addr = segs[curseg].ds_addr;
addr < (segs[curseg].ds_addr + segs[curseg].ds_len);
addr += NBPG, va += NBPG, size -= NBPG) {
addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
if (size == 0)
panic("_bus_dmamem_map: size botch");
pmap_enter(pmap_kernel(), va, addr,