summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-04-13 14:41:09 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-04-13 14:41:09 +0000
commitbeb2460a9f01cc26d177115bfac2ea2cbf8ea747 (patch)
tree139e9c859040a8fd95515e42268350fa31748d08 /sys/arch/alpha/dev
parent8c1a4cda99d30ee2fcf1fefb025eef5b3778e883 (diff)
Use PAGE_SIZE rather than NBPG.
From NetBSD ok martin@ miod@
Diffstat (limited to 'sys/arch/alpha/dev')
-rw-r--r--sys/arch/alpha/dev/bus_dma.c6
-rw-r--r--sys/arch/alpha/dev/sgmap_common.c8
-rw-r--r--sys/arch/alpha/dev/sgmap_typedep.c12
3 files changed, 13 insertions, 13 deletions
diff --git a/sys/arch/alpha/dev/bus_dma.c b/sys/arch/alpha/dev/bus_dma.c
index b16376ec7fc..6a2bf65b4f3 100644
--- a/sys/arch/alpha/dev/bus_dma.c
+++ b/sys/arch/alpha/dev/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.16 2006/03/18 19:00:06 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.17 2006/04/13 14:41:08 brad Exp $ */
/* $NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $ */
/*-
@@ -173,7 +173,7 @@ _bus_dmamap_load_buffer_direct_common(t, map, buf, buflen, p, flags,
/*
* 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)
@@ -598,7 +598,7 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags)
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,
diff --git a/sys/arch/alpha/dev/sgmap_common.c b/sys/arch/alpha/dev/sgmap_common.c
index 6393ff79627..dd8665ccf38 100644
--- a/sys/arch/alpha/dev/sgmap_common.c
+++ b/sys/arch/alpha/dev/sgmap_common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sgmap_common.c,v 1.8 2006/04/04 21:18:43 brad Exp $ */
+/* $OpenBSD: sgmap_common.c,v 1.9 2006/04/13 14:41:08 brad Exp $ */
/* $NetBSD: sgmap_common.c,v 1.13 2000/06/29 09:02:57 mrg Exp $ */
/*-
@@ -99,7 +99,7 @@ alpha_sgmap_init(t, sgmap, name, wbase, sgvabase, sgvasize, ptesize, ptva,
* this must be aligned to the page table size. However,
* some platforms have more strict alignment requirements.
*/
- ptsize = (sgvasize / NBPG) * ptesize;
+ ptsize = (sgvasize / PAGE_SIZE) * ptesize;
if (minptalign != 0) {
if (minptalign < ptsize)
minptalign = ptsize;
@@ -131,7 +131,7 @@ alpha_sgmap_init(t, sgmap, name, wbase, sgvabase, sgvasize, ptesize, ptva,
* Allocate a spill page if that hasn't already been done.
*/
if (alpha_sgmap_prefetch_spill_page_va == 0) {
- if (bus_dmamem_alloc(t, NBPG, 0, 0, &seg, 1, &rseg,
+ if (bus_dmamem_alloc(t, PAGE_SIZE, 0, 0, &seg, 1, &rseg,
BUS_DMA_NOWAIT)) {
printf("unable to allocate spill page for sgmap `%s'\n",
name);
@@ -140,7 +140,7 @@ alpha_sgmap_init(t, sgmap, name, wbase, sgvabase, sgvasize, ptesize, ptva,
alpha_sgmap_prefetch_spill_page_pa = seg.ds_addr;
alpha_sgmap_prefetch_spill_page_va =
ALPHA_PHYS_TO_K0SEG(alpha_sgmap_prefetch_spill_page_pa);
- bzero((caddr_t)alpha_sgmap_prefetch_spill_page_va, NBPG);
+ bzero((caddr_t)alpha_sgmap_prefetch_spill_page_va, PAGE_SIZE);
}
return;
diff --git a/sys/arch/alpha/dev/sgmap_typedep.c b/sys/arch/alpha/dev/sgmap_typedep.c
index 45217bfb829..e5164260582 100644
--- a/sys/arch/alpha/dev/sgmap_typedep.c
+++ b/sys/arch/alpha/dev/sgmap_typedep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sgmap_typedep.c,v 1.6 2006/03/27 20:46:44 brad Exp $ */
+/* $OpenBSD: sgmap_typedep.c,v 1.7 2006/04/13 14:41:08 brad Exp $ */
/* $NetBSD: sgmap_typedep.c,v 1.17 2001/07/19 04:27:37 thorpej Exp $ */
/*-
@@ -99,11 +99,11 @@ __C(SGMAP_TYPE,_load_buffer)(bus_dma_tag_t t, bus_dmamap_t map, void *buf,
va = trunc_page(va);
boundary = map->_dm_boundary;
- alignment = NBPG;
+ alignment = PAGE_SIZE;
sgvalen = (endva - va);
if (spill) {
- sgvalen += NBPG;
+ sgvalen += PAGE_SIZE;
/*
* ARGH! If the addition of the spill page bumped us
@@ -154,7 +154,7 @@ __C(SGMAP_TYPE,_load_buffer)(bus_dma_tag_t t, bus_dmamap_t map, void *buf,
map->dm_segs[seg].ds_addr);
#endif
- for (; va < endva; va += NBPG, pteidx++,
+ for (; va < endva; va += PAGE_SIZE, pteidx++,
pte = &page_table[pteidx * SGMAP_PTE_SPACING]) {
/* Get the physical address for this segment. */
if (p != NULL)
@@ -314,11 +314,11 @@ __C(SGMAP_TYPE,_unload)(bus_dma_tag_t t, bus_dmamap_t map,
osgva = sgva = trunc_page(sgva);
if (spill)
- esgva += NBPG;
+ esgva += PAGE_SIZE;
/* Invalidate the PTEs for the mapping. */
for (pteidx = sgva >> SGMAP_ADDR_PTEIDX_SHIFT;
- sgva < esgva; sgva += NBPG, pteidx++) {
+ sgva < esgva; sgva += PAGE_SIZE, pteidx++) {
pte = &page_table[pteidx * SGMAP_PTE_SPACING];
#ifdef SGMAP_DEBUG
if (__C(SGMAP_TYPE,_debug))