Use PAGE_SIZE rather than NBPG.
This commit is contained in:
parent
ecd9fdcc76
commit
bc226765c8
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: bus_dma.c,v 1.3 2003/01/17 23:36:10 thorpej Exp $ */
|
||||
/* $NetBSD: bus_dma.c,v 1.4 2003/04/02 03:27:35 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.3 2003/01/17 23:36:10 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.4 2003/04/02 03:27:35 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)
|
||||
|
@ -671,7 +671,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,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cpu_exec.c,v 1.35 2003/01/17 23:36:10 thorpej Exp $ */
|
||||
/* $NetBSD: cpu_exec.c,v 1.36 2003/04/02 03:27:35 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -247,18 +247,18 @@ mips_elf_makecmds (p, epp)
|
|||
#endif /*ELF_DEBUG*/
|
||||
|
||||
if (residue) {
|
||||
vaddr &= ~(NBPG - 1);
|
||||
offset &= ~(NBPG - 1);
|
||||
vaddr &= ~(PAGE_SIZE - 1);
|
||||
offset &= ~(PAGE_SIZE - 1);
|
||||
length = roundup (length + ph.p_vaddr
|
||||
- vaddr, NBPG);
|
||||
- vaddr, PAGE_SIZE);
|
||||
residue = (ph.p_vaddr + ph.p_memsz)
|
||||
- (vaddr + length);
|
||||
}
|
||||
} else {
|
||||
vaddr &= ~(NBPG - 1);
|
||||
offset &= ~(NBPG - 1);
|
||||
vaddr &= ~(PAGE_SIZE - 1);
|
||||
offset &= ~(PAGE_SIZE - 1);
|
||||
length = roundup (length + ph.p_vaddr - vaddr,
|
||||
NBPG);
|
||||
PAGE_SIZE);
|
||||
residue = (ph.p_vaddr + ph.p_memsz)
|
||||
- (vaddr + length);
|
||||
if (!epp->ep_taddr || vaddr < epp->ep_taddr)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: kgdb_machdep.c,v 1.5 2003/01/17 23:36:13 thorpej Exp $ */
|
||||
/* $NetBSD: kgdb_machdep.c,v 1.6 2003/04/02 03:27:35 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -138,11 +138,11 @@ kgdb_acc(va, len)
|
|||
{
|
||||
vaddr_t last_va;
|
||||
|
||||
last_va = va + len + NBPG - 1;
|
||||
last_va = va + len + PAGE_SIZE - 1;
|
||||
va &= ~PGOFSET;
|
||||
last_va &= ~PGOFSET;
|
||||
|
||||
for (; va < last_va; va += NBPG) {
|
||||
for (; va < last_va; va += PAGE_SIZE) {
|
||||
if (kvacc(va) == 0)
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mem.c,v 1.26 2002/10/23 09:11:36 jdolecek Exp $ */
|
||||
/* $NetBSD: mem.c,v 1.27 2003/04/02 03:27:35 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -134,10 +134,10 @@ mmrw(dev, uio, flags)
|
|||
break;
|
||||
}
|
||||
if (zeropage == NULL) {
|
||||
zeropage = malloc(NBPG, M_TEMP, M_WAITOK);
|
||||
memset(zeropage, 0, NBPG);
|
||||
zeropage = malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
|
||||
memset(zeropage, 0, PAGE_SIZE);
|
||||
}
|
||||
c = min(iov->iov_len, NBPG);
|
||||
c = min(iov->iov_len, PAGE_SIZE);
|
||||
error = uiomove(zeropage, c, uio);
|
||||
continue;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mips_machdep.c,v 1.158 2003/02/07 17:38:48 cgd Exp $ */
|
||||
/* $NetBSD: mips_machdep.c,v 1.159 2003/04/02 03:27:35 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2002 Wasabi Systems, Inc.
|
||||
|
@ -119,7 +119,7 @@
|
|||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
|
||||
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.158 2003/02/07 17:38:48 cgd Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.159 2003/04/02 03:27:35 thorpej Exp $");
|
||||
|
||||
#include "opt_cputype.h"
|
||||
|
||||
|
@ -1314,7 +1314,7 @@ cpu_dumpconf(void)
|
|||
/*
|
||||
* Dump the kernel's image to the swap partition.
|
||||
*/
|
||||
#define BYTES_PER_DUMP NBPG
|
||||
#define BYTES_PER_DUMP PAGE_SIZE
|
||||
|
||||
void
|
||||
dumpsys(void)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vm_machdep.c,v 1.94 2003/01/22 13:55:09 simonb Exp $ */
|
||||
/* $NetBSD: vm_machdep.c,v 1.95 2003/04/02 03:27:35 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988 University of Utah.
|
||||
|
@ -45,7 +45,7 @@
|
|||
#include "opt_ddb.h"
|
||||
|
||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.94 2003/01/22 13:55:09 simonb Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.95 2003/04/02 03:27:35 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -282,7 +282,7 @@ cpu_coredump(l, vp, cred, chdr)
|
|||
/*
|
||||
* Move pages from one kernel virtual address to another.
|
||||
* Both addresses are assumed to reside in the Sysmap,
|
||||
* and size must be a multiple of NBPG.
|
||||
* and size must be a multiple of PAGE_SIZE.
|
||||
*/
|
||||
void
|
||||
pagemove(from, to, size)
|
||||
|
@ -292,7 +292,7 @@ pagemove(from, to, size)
|
|||
pt_entry_t *fpte, *tpte;
|
||||
paddr_t invalid;
|
||||
|
||||
if (size % NBPG)
|
||||
if (size % PAGE_SIZE)
|
||||
panic("pagemove");
|
||||
fpte = kvtopte(from);
|
||||
tpte = kvtopte(to);
|
||||
|
@ -310,7 +310,7 @@ pagemove(from, to, size)
|
|||
fpte++; tpte++;
|
||||
size -= PAGE_SIZE;
|
||||
from += PAGE_SIZE;
|
||||
to += NBPG;
|
||||
to += PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue