Use PAGE_SIZE rather than NBPG.

This commit is contained in:
thorpej 2003-04-02 04:05:31 +00:00
parent 939003f2a8
commit 44b9a2a1ec
4 changed files with 33 additions and 33 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.36 2003/01/18 12:29:03 tsutsui Exp $ */
/* $NetBSD: machdep.c,v 1.37 2003/04/02 04:05:31 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -193,8 +193,8 @@ news68k_init()
* avail_end was pre-decremented in pmap_bootstrap to compensate.
*/
for (i = 0; i < btoc(MSGBUFSIZE); i++)
pmap_kenter_pa((vaddr_t)msgbufaddr + i * NBPG,
avail_end + i * NBPG, VM_PROT_READ|VM_PROT_WRITE)
pmap_kenter_pa((vaddr_t)msgbufaddr + i * PAGE_SIZE,
avail_end + i * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE)
pmap_update(pmap_kernel());
initmsgbuf(msgbufaddr, m68k_round_page(MSGBUFSIZE));
}
@ -270,7 +270,7 @@ cpu_startup()
* "base" pages for the rest.
*/
curbuf = (vaddr_t) buffers + (i * MAXBSIZE);
curbufsize = NBPG * ((i < residual) ? (base + 1) : base);
curbufsize = PAGE_SIZE * ((i < residual) ? (base + 1) : base);
while (curbufsize) {
pg = uvm_pagealloc(NULL, 0, NULL, 0);
@ -309,7 +309,7 @@ cpu_startup()
#endif
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
printf("avail memory = %s\n", pbuf);
format_bytes(pbuf, sizeof(pbuf), bufpages * NBPG);
format_bytes(pbuf, sizeof(pbuf), bufpages * PAGE_SIZE);
printf("using %u buffers containing %s of memory\n", nbuf, pbuf);
/*
@ -514,7 +514,7 @@ cpu_init_kcore_hdr()
* Initialize the `dispatcher' portion of the header.
*/
strcpy(h->name, machine);
h->page_size = NBPG;
h->page_size = PAGE_SIZE;
h->kernbase = KERNBASE;
/*
@ -608,7 +608,7 @@ long dumplo = 0; /* blocks */
/*
* This is called by main to set dumplo and dumpsize.
* Dumps always skip the first NBPG of disk space
* Dumps always skip the first PAGE_SIZE of disk space
* in case there might be a disk label stored there.
* If there is extra space, put dump at the end to
* reduce the chance that swapping trashes it.
@ -634,7 +634,7 @@ cpu_dumpconf()
/*
* Check do see if we will fit. Note we always skip the
* first NBPG in case there is a disk label there.
* first PAGE_SIZE in case there is a disk label there.
*/
if (nblks < (ctod(dumpsize) + chdrsize + ctod(1))) {
dumpsize = 0;
@ -696,7 +696,7 @@ dumpsys()
goto bad;
for (pg = 0; pg < dumpsize; pg++) {
#define NPGMB (1024*1024/NBPG)
#define NPGMB (1024*1024/PAGE_SIZE)
/* print out how many MBs we have dumped */
if (pg && (pg % NPGMB) == 0)
printf("%d ", pg / NPGMB);
@ -705,12 +705,12 @@ dumpsys()
VM_PROT_READ, VM_PROT_READ|PMAP_WIRED);
pmap_update(pmap_kernel());
error = (*dump)(dumpdev, blkno, vmmap, NBPG);
error = (*dump)(dumpdev, blkno, vmmap, PAGE_SIZE);
bad:
switch (error) {
case 0:
maddr += NBPG;
blkno += btodb(NBPG);
maddr += PAGE_SIZE;
blkno += btodb(PAGE_SIZE);
break;
case ENXIO:
@ -754,7 +754,7 @@ initcpu()
if (ectype == EC_VIRT)
mappedcopysize = -1; /* in case it was patched */
else
mappedcopysize = NBPG;
mappedcopysize = PAGE_SIZE;
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.12 2002/10/23 09:11:40 jdolecek Exp $ */
/* $NetBSD: mem.c,v 1.13 2003/04/02 04:05:32 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -120,10 +120,10 @@ mmrw(dev, uio, flags)
trunc_page(v), prot, prot|PMAP_WIRED);
pmap_update(pmap_kernel());
o = m68k_page_offset(uio->uio_offset);
c = min(uio->uio_resid, (int)(NBPG - o));
c = min(uio->uio_resid, (int)(PAGE_SIZE - o));
error = uiomove((caddr_t)vmmap + o, c, uio);
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
(vaddr_t)vmmap + NBPG);
(vaddr_t)vmmap + PAGE_SIZE);
pmap_update(pmap_kernel());
continue;
@ -161,8 +161,8 @@ mmrw(dev, uio, flags)
*/
if (devzeropage == NULL)
devzeropage = (caddr_t)
malloc(NBPG, M_TEMP, M_WAITOK|M_ZERO);
c = min(iov->iov_len, NBPG);
malloc(PAGE_SIZE, M_TEMP, M_WAITOK|M_ZERO);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(devzeropage, c, uio);
continue;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.7 2003/01/18 12:29:03 tsutsui Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.8 2003/04/02 04:05:32 thorpej Exp $ */
/*
* Copyright (c) 1991, 1993
@ -144,15 +144,15 @@ pmap_bootstrap(nextpa, firstpa)
kstsize = 1;
#endif
kstpa = nextpa;
nextpa += kstsize * NBPG;
nextpa += kstsize * PAGE_SIZE;
kptpa = nextpa;
nptpages = RELOC(Sysptsize, int) +
(iiomapsize + eiomapsize + NPTEPG - 1) / NPTEPG;
nextpa += nptpages * NBPG;
nextpa += nptpages * PAGE_SIZE;
eiopa = nextpa - eiomapsize * sizeof(pt_entry_t);
iiopa = eiopa - iiomapsize * sizeof(pt_entry_t);
kptmpa = nextpa;
nextpa += NBPG;
nextpa += PAGE_SIZE;
p0upa = nextpa;
nextpa += USPACE;
@ -247,7 +247,7 @@ pmap_bootstrap(nextpa, firstpa)
protopte = kptpa | PG_RW | PG_CI | PG_V;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
protopte += PAGE_SIZE;
}
/*
* Invalidate all but the last remaining entry.
@ -272,8 +272,8 @@ pmap_bootstrap(nextpa, firstpa)
while (pte < epte) {
*ste++ = protoste;
*pte++ = protopte;
protoste += NBPG;
protopte += NBPG;
protoste += PAGE_SIZE;
protopte += PAGE_SIZE;
}
/*
* Invalidate all but the last remaining entries in both.
@ -301,7 +301,7 @@ pmap_bootstrap(nextpa, firstpa)
protopte = firstpa | PG_RO | PG_V;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
protopte += PAGE_SIZE;
}
/*
* Validate PTEs for kernel data/bss, dynamic data allocated
@ -319,7 +319,7 @@ pmap_bootstrap(nextpa, firstpa)
#endif
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
protopte += PAGE_SIZE;
}
/*
* Finally, validate the internal IO space PTEs (RW+CI).
@ -329,7 +329,7 @@ pmap_bootstrap(nextpa, firstpa)
protopte = RELOC(intiobase_phys, u_int) | PG_RW | PG_CI | PG_V;
while (pte < epte) {
*pte++ = protopte;
protopte += NBPG;
protopte += PAGE_SIZE;
}
/*
@ -480,11 +480,11 @@ pmap_bootstrap(nextpa, firstpa)
vaddr_t va = RELOC(virtual_avail, vaddr_t);
RELOC(CADDR1, caddr_t) = (caddr_t)va;
va += NBPG;
va += PAGE_SIZE;
RELOC(CADDR2, caddr_t) = (caddr_t)va;
va += NBPG;
va += PAGE_SIZE;
RELOC(vmmap, caddr_t) = (caddr_t)va;
va += NBPG;
va += PAGE_SIZE;
RELOC(msgbufaddr, caddr_t) = (caddr_t)va;
va += m68k_round_page(MSGBUFSIZE);
RELOC(virtual_avail, vaddr_t) = va;

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.26 2003/01/28 22:35:12 wiz Exp $ */
/* $NetBSD: trap.c,v 1.27 2003/04/02 04:05:32 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -718,7 +718,7 @@ writeback(fp, docachepush)
(void) pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
DCFL(pa);
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
(vaddr_t)&vmmap[NBPG]);
(vaddr_t)&vmmap[PAGE_SIZE]);
pmap_update(pmap_kernel());
} else
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",