From 89a25a097c9c9659655f4d8738f54cb4f69d1c27 Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 1 Apr 2003 02:13:53 +0000 Subject: [PATCH] Use PAGE_SIZE rather than NBPG. --- sys/arch/acorn32/podulebus/cosc.c | 7 +++++-- sys/arch/acorn32/podulebus/csc.c | 7 +++++-- sys/arch/acorn32/podulebus/esc.c | 6 +++--- sys/arch/acorn32/podulebus/ptsc.c | 9 ++++++--- sys/arch/acorn32/podulebus/sfas.c | 4 ++-- sys/arch/algor/algor/bus_dma.c | 8 ++++---- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/sys/arch/acorn32/podulebus/cosc.c b/sys/arch/acorn32/podulebus/cosc.c index 89639624c2e5..44c2b181e028 100644 --- a/sys/arch/acorn32/podulebus/cosc.c +++ b/sys/arch/acorn32/podulebus/cosc.c @@ -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 #include #include + +#include + #include #include #include @@ -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); diff --git a/sys/arch/acorn32/podulebus/csc.c b/sys/arch/acorn32/podulebus/csc.c index ed6b71ec2e98..90f3c566610d 100644 --- a/sys/arch/acorn32/podulebus/csc.c +++ b/sys/arch/acorn32/podulebus/csc.c @@ -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 #include #include + +#include + #include #include #include @@ -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); diff --git a/sys/arch/acorn32/podulebus/esc.c b/sys/arch/acorn32/podulebus/esc.c index 1af8b64c3534..af7e475c22b9 100644 --- a/sys/arch/acorn32/podulebus/esc.c +++ b/sys/arch/acorn32/podulebus/esc.c @@ -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 -__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 #include @@ -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); } diff --git a/sys/arch/acorn32/podulebus/ptsc.c b/sys/arch/acorn32/podulebus/ptsc.c index 83f8b90483e9..c048672ba020 100644 --- a/sys/arch/acorn32/podulebus/ptsc.c +++ b/sys/arch/acorn32/podulebus/ptsc.c @@ -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 #include #include + +#include + #include #include #include @@ -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; diff --git a/sys/arch/acorn32/podulebus/sfas.c b/sys/arch/acorn32/podulebus/sfas.c index f857721f009d..9b750babc2ef 100644 --- a/sys/arch/acorn32/podulebus/sfas.c +++ b/sys/arch/acorn32/podulebus/sfas.c @@ -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); } diff --git a/sys/arch/algor/algor/bus_dma.c b/sys/arch/algor/algor/bus_dma.c index 94ac91fdd6b3..b920567d7a60 100644 --- a/sys/arch/algor/algor/bus_dma.c +++ b/sys/arch/algor/algor/bus_dma.c @@ -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 /* 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 #include @@ -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,