Use PAGE_SIZE rather than NBPG.

This commit is contained in:
thorpej 2003-04-01 21:26:26 +00:00
parent d35a2d2955
commit 8818afa48e
21 changed files with 199 additions and 157 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: amiga_init.c,v 1.83 2003/01/11 10:47:08 aymeric Exp $ */
/* $NetBSD: amiga_init.c,v 1.84 2003/04/01 21:26:26 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@ -35,7 +35,7 @@
#include "opt_p5ppc68kboard.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.83 2003/01/11 10:47:08 aymeric Exp $");
__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.84 2003/04/01 21:26:26 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -299,10 +299,11 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
RELOC(use_z2_mem, int) * 7;
RELOC(NZTWOMEMPG, u_int) =
(RELOC(z2mem_end, paddr_t) -
RELOC(z2mem_start, paddr_t)) / NBPG;
RELOC(z2mem_start, paddr_t)) / PAGE_SIZE;
if ((RELOC(z2mem_end, paddr_t) -
RELOC(z2mem_start, paddr_t)) > sp->ms_size) {
RELOC(NZTWOMEMPG, u_int) = sp->ms_size / NBPG;
RELOC(NZTWOMEMPG, u_int) = sp->ms_size /
PAGE_SIZE;
RELOC(z2mem_start, paddr_t) =
RELOC(z2mem_end, paddr_t) - sp->ms_size;
}
@ -361,9 +362,9 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
*/
RELOC(Sysseg_pa, u_int) = pstart;
RELOC(Sysseg, u_int) = vstart;
vstart += NBPG * kstsize;
pstart += NBPG * kstsize;
avail -= NBPG * kstsize;
vstart += PAGE_SIZE * kstsize;
pstart += PAGE_SIZE * kstsize;
avail -= PAGE_SIZE * kstsize;
/*
* allocate initial page table pages
@ -392,9 +393,9 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
*/
RELOC(Sysptmap, u_int) = vstart;
Sysptmap_pa = pstart;
vstart += NBPG;
pstart += NBPG;
avail -= NBPG;
vstart += PAGE_SIZE;
pstart += PAGE_SIZE;
avail -= PAGE_SIZE;
/*
* pt maps the first N megs of ram Sysptmap comes directly
@ -407,10 +408,10 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
* pt[0] maps address 0 so:
*
* ptsize
* Sysmap = ------ * NBPG
* Sysmap = ------ * PAGE_SIZE
* 4
*/
RELOC(Sysmap, u_int *) = (u_int *)(ptsize * (NBPG / 4));
RELOC(Sysmap, u_int *) = (u_int *)(ptsize * (PAGE_SIZE / 4));
/*
* initialize segment table and page table map
@ -464,12 +465,12 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
pg_proto = ptpa | PG_RW | PG_CI | PG_V;
while (sg < esg) {
*sg++ = pg_proto;
pg_proto += NBPG;
pg_proto += PAGE_SIZE;
}
/*
* Invalidate rest of Sysptmap page
*/
esg = (u_int *)(Sysptmap_pa + NBPG);
esg = (u_int *)(Sysptmap_pa + PAGE_SIZE);
while (sg < esg)
*sg++ = SG_NV;
} else
@ -488,13 +489,13 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
while (pg < esg) {
*sg++ = sg_proto;
*pg++ = pg_proto;
sg_proto += NBPG;
pg_proto += NBPG;
sg_proto += PAGE_SIZE;
pg_proto += PAGE_SIZE;
}
/*
* invalidate the remainder of each table
*/
esg = (u_int *)(Sysptmap_pa + NBPG);
esg = (u_int *)(Sysptmap_pa + PAGE_SIZE);
while (pg < esg) {
*sg++ = SG_NV;
*pg++ = PG_NV;
@ -507,8 +508,9 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
pg_proto = fphystart | PG_RO | PG_V; /* text pages are RO */
pg = (u_int *) ptpa;
*pg++ = PG_NV; /* Make page 0 invalid */
pg_proto += NBPG;
for (i = NBPG; i < (u_int) etext; i += NBPG, pg_proto += NBPG)
pg_proto += PAGE_SIZE;
for (i = PAGE_SIZE; i < (u_int) etext;
i += PAGE_SIZE, pg_proto += PAGE_SIZE)
*pg++ = pg_proto;
/*
@ -532,11 +534,12 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
* of the kernel are contiguously allocated, start at
* Sysseg and end at the current value of vstart.
*/
for (; i<RELOC(Sysseg, u_int); i+= NBPG, pg_proto += NBPG)
for (; i<RELOC(Sysseg, u_int);
i+= PAGE_SIZE, pg_proto += PAGE_SIZE)
*pg++ = pg_proto;
pg_proto = (pg_proto & ~PG_CCB) | PG_CI;
for (; i < vstart; i += NBPG, pg_proto += NBPG)
for (; i < vstart; i += PAGE_SIZE, pg_proto += PAGE_SIZE)
*pg++ = pg_proto;
pg_proto = (pg_proto & ~PG_CI);
@ -548,7 +551,7 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
* go till end of data allocated so far
* plus proc0 u-area (to be allocated)
*/
for (; i < vstart + USPACE; i += NBPG, pg_proto += NBPG)
for (; i < vstart + USPACE; i += PAGE_SIZE, pg_proto += PAGE_SIZE)
*pg++ = pg_proto;
/*
* invalidate remainder of kernel PT
@ -586,7 +589,7 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
/* CI needed here?? */
while (pg_proto < CHIPMEMTOP) {
*pg++ = pg_proto;
pg_proto += NBPG;
pg_proto += PAGE_SIZE;
}
}
if (RELOC(z2mem_end, paddr_t)) { /* XXX */
@ -594,7 +597,7 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
PG_RW | PG_V; /* XXX */
while (pg_proto < RELOC(z2mem_end, paddr_t)) { /* XXX */
*pg++ = pg_proto; /* XXX */
pg_proto += NBPG; /* XXX */
pg_proto += PAGE_SIZE; /* XXX */
} /* XXX */
} /* XXX */
#ifdef DRACO
@ -604,12 +607,12 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
pg_proto = CIABASE | PG_RW | PG_CI | PG_V;
while (pg_proto < CIATOP) {
*pg++ = pg_proto;
pg_proto += NBPG;
pg_proto += PAGE_SIZE;
}
pg_proto = ZTWOROMBASE | PG_RW | PG_CI | PG_V;
while (pg_proto < ZTWOROMTOP) {
*pg++ = pg_proto;
pg_proto += NBPG;
pg_proto += PAGE_SIZE;
}
}
@ -657,21 +660,21 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
#ifdef DRACO
if ((id >> 24) == 0x7D) {
RELOC(DRCCADDR, u_int) =
(u_int)RELOC(Sysmap, u_int) - ptextra * NBPG;
(u_int)RELOC(Sysmap, u_int) - ptextra * PAGE_SIZE;
RELOC(CIAADDR, vaddr_t) =
RELOC(DRCCADDR, u_int) + DRCIAPG * NBPG;
RELOC(DRCCADDR, u_int) + DRCIAPG * PAGE_SIZE;
if (RELOC(z2mem_end, vaddr_t)) { /* XXX */
RELOC(ZTWOMEMADDR, vaddr_t) =
RELOC(DRCCADDR, u_int) + NDRCCPG * NBPG;
RELOC(DRCCADDR, u_int) + NDRCCPG * PAGE_SIZE;
RELOC(ZBUSADDR, vaddr_t) =
RELOC(ZTWOMEMADDR, vaddr_t) +
RELOC(NZTWOMEMPG, u_int)*NBPG;
RELOC(NZTWOMEMPG, u_int)*PAGE_SIZE;
} else {
RELOC(ZBUSADDR, vaddr_t) =
RELOC(DRCCADDR, u_int) + NDRCCPG * NBPG;
RELOC(DRCCADDR, u_int) + NDRCCPG * PAGE_SIZE;
}
/*
@ -682,22 +685,24 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
#endif
{
RELOC(CHIPMEMADDR, vaddr_t) =
(u_int)RELOC(Sysmap, u_int) - ptextra * NBPG;
(u_int)RELOC(Sysmap, u_int) - ptextra * PAGE_SIZE;
if (RELOC(z2mem_end, u_int) == 0)
RELOC(CIAADDR, vaddr_t) =
RELOC(CHIPMEMADDR, vaddr_t) + NCHIPMEMPG * NBPG;
RELOC(CHIPMEMADDR, vaddr_t) +
NCHIPMEMPG * PAGE_SIZE;
else {
RELOC(ZTWOMEMADDR, vaddr_t) =
RELOC(CHIPMEMADDR, vaddr_t) + NCHIPMEMPG * NBPG;
RELOC(CHIPMEMADDR, vaddr_t) +
NCHIPMEMPG * PAGE_SIZE;
RELOC(CIAADDR, vaddr_t) = RELOC(ZTWOMEMADDR, vaddr_t) +
RELOC(NZTWOMEMPG, u_int) * NBPG;
RELOC(NZTWOMEMPG, u_int) * PAGE_SIZE;
}
RELOC(ZTWOROMADDR, vaddr_t) =
RELOC(CIAADDR, vaddr_t) + NCIAPG * NBPG;
RELOC(CIAADDR, vaddr_t) + NCIAPG * PAGE_SIZE;
RELOC(ZBUSADDR, vaddr_t) =
RELOC(ZTWOROMADDR, vaddr_t) + NZTWOROMPG * NBPG;
RELOC(ZTWOROMADDR, vaddr_t) + NZTWOROMPG * PAGE_SIZE;
/* not on 8k boundary :-( */
RELOC(CIAADDR, vaddr_t) += NBPG/2;
RELOC(CIAADDR, vaddr_t) += PAGE_SIZE/2;
RELOC(CUSTOMADDR, vaddr_t) =
RELOC(ZTWOROMADDR, vaddr_t) - ZTWOROMBASE + CUSTOMBASE;
/*
@ -797,7 +802,7 @@ start_c_finish()
if ((id >> 24) == 0x7D) { /* mapping on, is_draco() is valid */
int i;
/* XXX experimental Altais register mapping only */
altaiscolpt = (volatile u_int8_t *)(DRCCADDR+NBPG*9+0x3c8);
altaiscolpt = (volatile u_int8_t *)(DRCCADDR+PAGE_SIZE*9+0x3c8);
altaiscol = altaiscolpt + 1;
for (i=0; i<140000; i++) {
*altaiscolpt = 0;
@ -822,10 +827,10 @@ start_c_finish()
#ifdef DRACO
if (is_draco()) {
draco_intena = (volatile u_int8_t *)DRCCADDR+1;
draco_intpen = draco_intena + NBPG;
draco_intfrc = draco_intpen + NBPG;
draco_misc = draco_intfrc + NBPG;
draco_ioct = (struct drioct *)(DRCCADDR + DRIOCTLPG*NBPG);
draco_intpen = draco_intena + PAGE_SIZE;
draco_intfrc = draco_intpen + PAGE_SIZE;
draco_misc = draco_intfrc + PAGE_SIZE;
draco_ioct = (struct drioct *)(DRCCADDR + DRIOCTLPG*PAGE_SIZE);
} else
#endif
{
@ -840,7 +845,7 @@ start_c_finish()
/* XXX is: this MUST NOT BE DONE before the pmap_bootstrap() call */
if (z2mem_end) {
z2mem_end = ZTWOMEMADDR + NZTWOMEMPG * NBPG;
z2mem_end = ZTWOMEMADDR + NZTWOMEMPG * PAGE_SIZE;
z2mem_start = ZTWOMEMADDR;
}
@ -869,10 +874,10 @@ start_c_finish()
~(DRSTAT2_PARIRQENA|DRSTAT2_TMRINTENA); /* some more */
*(volatile u_int8_t *)(DRCCADDR + 1 +
DRSUPIOPG*NBPG + 4*(0x3F8 + 1)) = 0; /* and com0 */
DRSUPIOPG*PAGE_SIZE + 4*(0x3F8 + 1)) = 0; /* and com0 */
*(volatile u_int8_t *)(DRCCADDR + 1 +
DRSUPIOPG*NBPG + 4*(0x2F8 + 1)) = 0; /* and com1 */
DRSUPIOPG*PAGE_SIZE + 4*(0x2F8 + 1)) = 0; /* and com1 */
draco_ioct->io_control |= DRCNTRL_WDOGDIS; /* stop Fido */
*draco_misc &= ~1/*DRMISC_FASTZ2*/;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cc.c,v 1.16 2003/01/06 13:04:56 wiz Exp $ */
/* $NetBSD: cc.c,v 1.17 2003/04/01 21:26:26 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -31,12 +31,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.16 2003/01/06 13:04:56 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: cc.c,v 1.17 2003/04/01 21:26:26 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
#include <amiga/amiga/custom.h>
#include <amiga/amiga/cc.h>
#include "audio.h"
@ -486,7 +488,7 @@ cc_init_chipmem()
int s = splhigh ();
struct mem_node *mem;
chip_size = chipmem_end - (chipmem_start + NBPG);
chip_size = chipmem_end - (chipmem_start + PAGE_SIZE);
chip_total = chip_size - sizeof(*mem);
mem = (struct mem_node *)chipmem_steal(chip_size);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.179 2003/01/17 22:17:05 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.180 2003/04/01 21:26:26 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -46,7 +46,7 @@
#include "opt_compat_netbsd.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.179 2003/01/17 22:17:05 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.180 2003/04/01 21:26:26 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -247,8 +247,8 @@ cpu_startup()
*/
for (i = 0; i < btoc(MSGBUFSIZE); i++)
pmap_enter(pmap_kernel(), (vaddr_t)msgbufaddr + i * NBPG,
msgbufpa + i * NBPG, VM_PROT_READ|VM_PROT_WRITE,
pmap_enter(pmap_kernel(), (vaddr_t)msgbufaddr + i * PAGE_SIZE,
msgbufpa + i * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE,
VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
pmap_update(pmap_kernel());
initmsgbuf(msgbufaddr, m68k_round_page(MSGBUFSIZE));
@ -300,7 +300,7 @@ cpu_startup()
* "base" pages for the rest.
*/
curbuf = (vm_offset_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);
@ -340,7 +340,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);
/*
@ -606,7 +606,7 @@ cpu_dumpconf()
* Intitialize the `dispatcher' portion of the header.
*/
strcpy(h->name, machine);
h->page_size = NBPG;
h->page_size = PAGE_SIZE;
h->kernbase = KERNBASE;
/*
@ -666,11 +666,11 @@ cpu_dumpconf()
}
--dumplo; /* XXX assume header fits in one block */
/*
* Don't dump on the first NBPG (why NBPG?)
* Don't dump on the first PAGE_SIZE (why PAGE_SIZE?)
* in case the dump device includes a disk label.
*/
if (dumplo < btodb(NBPG))
dumplo = btodb(NBPG);
if (dumplo < btodb(PAGE_SIZE))
dumplo = btodb(PAGE_SIZE);
}
/*
@ -760,9 +760,9 @@ dumpsys()
n = BYTES_PER_DUMP;
if (maddr == 0) { /* XXX kvtop chokes on this */
maddr += NBPG;
n -= NBPG;
i += NBPG;
maddr += PAGE_SIZE;
n -= PAGE_SIZE;
i += PAGE_SIZE;
++blkno; /* XXX skip physical page 0 */
}
(void) pmap_map(dumpspace, maddr, maddr + n, VM_PROT_READ);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.36 2002/10/23 09:10:29 jdolecek Exp $ */
/* $NetBSD: mem.c,v 1.37 2003/04/01 21:26:27 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.36 2002/10/23 09:10:29 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.37 2003/04/01 21:26:27 thorpej Exp $");
/*
* Memory special file
@ -128,10 +128,10 @@ mmrw(dev, uio, flags)
trunc_page(v), prot, prot|PMAP_WIRED);
pmap_update(pmap_kernel());
o = uio->uio_offset & PGOFSET;
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(), (vm_offset_t)vmmap,
(vm_offset_t)vmmap + NBPG);
(vm_offset_t)vmmap + PAGE_SIZE);
pmap_update(pmap_kernel());
continue;
@ -141,7 +141,7 @@ mmrw(dev, uio, flags)
if (!uvm_kernacc((caddr_t)v, c,
uio->uio_rw == UIO_READ ? B_READ : B_WRITE))
return (EFAULT);
if (v < NBPG) {
if (v < PAGE_SIZE) {
#ifdef DEBUG
/*
* For now, return zeros on read of page 0
@ -150,11 +150,11 @@ mmrw(dev, uio, flags)
if (uio->uio_rw == UIO_READ) {
if (devzeropage == NULL) {
devzeropage = (caddr_t)
malloc(NBPG, M_TEMP,
malloc(PAGE_SIZE, M_TEMP,
M_WAITOK);
bzero(devzeropage, NBPG);
bzero(devzeropage, PAGE_SIZE);
}
c = min(c, NBPG - (int)v);
c = min(c, PAGE_SIZE - (int)v);
v = (vm_offset_t) devzeropage;
} else
#endif
@ -180,10 +180,10 @@ mmrw(dev, uio, flags)
}
if (devzeropage == NULL) {
devzeropage = (caddr_t)
malloc(NBPG, M_TEMP, M_WAITOK);
bzero(devzeropage, NBPG);
malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
bzero(devzeropage, PAGE_SIZE);
}
c = min(iov->iov_len, NBPG);
c = min(iov->iov_len, PAGE_SIZE);
error = uiomove(devzeropage, c, uio);
continue;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.103 2003/01/17 22:17:05 thorpej Exp $ */
/* $NetBSD: pmap.c,v 1.104 2003/04/01 21:26:27 thorpej Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -80,7 +80,6 @@
* For 68020/68030 machines with 68851, or 68030 MMUs
* Don't even pay lip service to multiprocessor support.
*
* will only work for PAGE_SIZE == NBPG
* right now because of the assumed one-to-one relationship of PT
* pages to STEs.
*/
@ -112,7 +111,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.103 2003/01/17 22:17:05 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.104 2003/04/01 21:26:27 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -440,7 +439,7 @@ pmap_bootstrap(firstaddr, loadaddr)
uvm_page_physload(atop(fromads), atop(toads),
atop(fromads), atop(toads), (fromads & 0xff000000) ?
VM_FREELIST_DEFAULT : VM_FREELIST_ZORROII);
physmem += (toads - fromads) / NBPG;
physmem += (toads - fromads) / PAGE_SIZE;
++i;
if (noncontig_enable == 1)
break; /* Only two segments enabled */
@ -477,7 +476,7 @@ pmap_bootstrap(firstaddr, loadaddr)
* Allocate all the submaps we need
*/
#define SYSMAP(c, p, v, n) \
v = (c)va; va += ((n)*NBPG); p = pte; pte += (n);
v = (c)va; va += ((n)*PAGE_SIZE); p = pte; pte += (n);
va = virtual_avail;
pte = pmap_pte(pmap_kernel(), va);
@ -607,7 +606,7 @@ pmap_init()
* we need enough pages to map the page tables for each process
* plus some slop.
*/
npg = howmany(((maxproc + 16) * AMIGA_UPTSIZE / NPTEPG), NBPG);
npg = howmany(((maxproc + 16) * AMIGA_UPTSIZE / NPTEPG), PAGE_SIZE);
#ifdef NKPTADD
npg += NKPTADD;
#else
@ -643,7 +642,7 @@ pmap_init()
kpt_pages = &((struct kpt_page *)addr2)[npg];
kpt_free_list = NULL;
do {
addr2 -= NBPG;
addr2 -= PAGE_SIZE;
(--kpt_pages)->kpt_next = kpt_free_list;
kpt_free_list = kpt_pages;
kpt_pages->kpt_va = addr2;
@ -708,7 +707,7 @@ pmap_init()
while (paddr < (paddr_t)Segtabzeropa + AMIGA_STSIZE) {
pmap_changebit(paddr, PG_CCB, 0);
pmap_changebit(paddr, PG_CI, 1);
paddr += NBPG;
paddr += PAGE_SIZE;
}
DCIS();
@ -724,7 +723,7 @@ pmap_alloc_pv()
int i;
if (pv_nfree == 0) {
pvp = (struct pv_page *)uvm_km_zalloc(kernel_map, NBPG);
pvp = (struct pv_page *)uvm_km_zalloc(kernel_map, PAGE_SIZE);
if (pvp == 0)
panic("pmap_alloc_pv: uvm_km_zalloc() failed");
pvp->pvp_pgi.pgi_freelist = pv = &pvp->pvp_pv[1];
@ -768,7 +767,7 @@ pmap_free_pv(pv)
case NPVPPG:
pv_nfree -= NPVPPG - 1;
TAILQ_REMOVE(&pv_page_freelist, pvp, pvp_pgi.pgi_list);
uvm_km_free(kernel_map, (vaddr_t)pvp, NBPG);
uvm_km_free(kernel_map, (vaddr_t)pvp, PAGE_SIZE);
break;
}
}
@ -1495,7 +1494,7 @@ pmap_kremove(va, len)
TBIS(sva);
}
pte++;
sva += NBPG;
sva += PAGE_SIZE;
}
}
}
@ -1675,7 +1674,7 @@ pmap_collect1(pmap, startpa, endpa)
int opmapdebug = 0;
#endif
for (pa = startpa; pa < endpa; pa += NBPG) {
for (pa = startpa; pa < endpa; pa += PAGE_SIZE) {
struct kpt_page *kpt, **pkpt;
/*
@ -1701,7 +1700,7 @@ pmap_collect1(pmap, startpa, endpa)
continue;
ok:
#endif
pte = (int *)(pv->pv_va + NBPG);
pte = (int *)(pv->pv_va + PAGE_SIZE);
while (--pte >= (pt_entry_t *)pv->pv_va && *pte == PG_NV)
;
if (pte >= (pt_entry_t *)pv->pv_va)
@ -2477,7 +2476,7 @@ pmap_enter_ptpage(pmap, va)
AMIGA_STSIZE) {
pmap_changebit(stpa, PG_CCB, 0);
pmap_changebit(stpa, PG_CI, 1);
stpa += NBPG;
stpa += PAGE_SIZE;
}
DCIS(); /* XXX */
}
@ -2526,12 +2525,12 @@ pmap_enter_ptpage(pmap, va)
/*
* Since a level 2 descriptor maps a block of SG4_LEV3SIZE
* level 3 descriptors, we need a chunk of NPTEPG/SEG4_LEV3SIZE
* (64) such descriptors (NBPG/SG4_LEV3SIZE bytes) to map a
* (64) such descriptors (PAGE_SIZE/SG4_LEV3SIZE bytes) to map a
* PT page -- the unit of allocation. We set 'ste' to point
* to the first entry of that chunk which is validated in its
* entirety below.
*/
ste = (u_int *)((int)ste & ~(NBPG / SG4_LEV3SIZE - 1));
ste = (u_int *)((int)ste & ~(PAGE_SIZE / SG4_LEV3SIZE - 1));
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
printf("enter_pt: ste2 %p (%p)\n",
@ -2571,7 +2570,7 @@ pmap_enter_ptpage(pmap, va)
kpt->kpt_next = kpt_used_list;
kpt_used_list = kpt;
ptpa = kpt->kpt_pa;
bzero((char *)kpt->kpt_va, NBPG);
bzero((char *)kpt->kpt_va, PAGE_SIZE);
pmap_enter(pmap, va, ptpa, VM_PROT_READ | VM_PROT_WRITE,
VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED);
pmap_update(pmap);
@ -2737,7 +2736,8 @@ pmap_check_wiring(str, va)
}
count = 0;
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + NBPG); pte++)
for (pte = (pt_entry_t *)va; pte < (pt_entry_t *)(va + PAGE_SIZE);
pte++)
if (*pte)
count++;
if (pg->wire_count != count)

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.89 2003/01/17 22:17:05 thorpej Exp $ */
/* $NetBSD: trap.c,v 1.90 2003/04/01 21:26:27 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -47,7 +47,7 @@
#include "opt_compat_sunos.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.89 2003/01/17 22:17:05 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.90 2003/04/01 21:26:27 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -322,7 +322,7 @@ trapmmufault(type, code, v, fp, l, sticks)
* Print out some data about the fault
*/
#ifdef DEBUG_PAGE0
if (v < NBPG) /* XXX PAGE0 */
if (v < PAGE_SIZE) /* XXX PAGE0 */
mmudebug |= 0x100; /* XXX PAGE0 */
#endif
if (mmudebug && mmutype == MMU_68040) {
@ -351,7 +351,7 @@ trapmmufault(type, code, v, fp, l, sticks)
#ifdef DDB /* XXX PAGE0 */
if (v < NBPG) /* XXX PAGE0 */
if (v < PAGE_SIZE) /* XXX PAGE0 */
Debugger(); /* XXX PAGE0 */
#endif /* XXX PAGE0 */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: bzivsc.c,v 1.14 2002/10/02 04:55:48 thorpej Exp $ */
/* $NetBSD: bzivsc.c,v 1.15 2003/04/01 21:26:28 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bzivsc.c,v 1.14 2002/10/02 04:55:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: bzivsc.c,v 1.15 2003/04/01 21:26:28 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -50,6 +50,8 @@ __KERNEL_RCSID(0, "$NetBSD: bzivsc.c,v 1.14 2002/10/02 04:55:48 thorpej Exp $");
#include <sys/user.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -350,7 +352,7 @@ bzivsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
bsc->sc_dmasize = bzivsc_max_dma;
ptr = *addr; /* Kernel virtual address */
pa = kvtop(ptr); /* Physical address of DMA */
xfer = min(bsc->sc_dmasize, NBPG - (pa & (NBPG - 1)));
xfer = min(bsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
bsc->sc_xfr_align = 0;
/*
* If output and unaligned, stuff odd byte into FIFO
@ -375,10 +377,10 @@ bzivsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
while (xfer < bsc->sc_dmasize) {
if ((pa + xfer) != kvtop(*addr + xfer))
break;
if ((bsc->sc_dmasize - xfer) < NBPG)
if ((bsc->sc_dmasize - xfer) < PAGE_SIZE)
xfer = bsc->sc_dmasize;
else
xfer += NBPG;
xfer += PAGE_SIZE;
++bzivsc_cnt_dma3;
}
if (xfer != *len)

View File

@ -1,4 +1,4 @@
/* $NetBSD: bzsc.c,v 1.32 2002/10/02 04:55:48 thorpej Exp $ */
/* $NetBSD: bzsc.c,v 1.33 2003/04/01 21:26:28 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bzsc.c,v 1.32 2002/10/02 04:55:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: bzsc.c,v 1.33 2003/04/01 21:26:28 thorpej Exp $");
/*
* Initial amiga Blizzard 1230-II driver by Daniel Widenfalk. Conversion to
@ -56,6 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: bzsc.c,v 1.32 2002/10/02 04:55:48 thorpej Exp $");
#include <sys/user.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -354,7 +356,7 @@ bzsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
bsc->sc_dmasize = bzsc_max_dma;
ptr = *addr; /* Kernel virtual address */
pa = kvtop(ptr); /* Physical address of DMA */
xfer = min(bsc->sc_dmasize, NBPG - (pa & (NBPG - 1)));
xfer = min(bsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
bsc->sc_xfr_align = 0;
/*
* If output and unaligned, stuff odd byte into FIFO
@ -379,10 +381,10 @@ bzsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
while (xfer < bsc->sc_dmasize) {
if ((pa + xfer) != kvtop(*addr + xfer))
break;
if ((bsc->sc_dmasize - xfer) < NBPG)
if ((bsc->sc_dmasize - xfer) < PAGE_SIZE)
xfer = bsc->sc_dmasize;
else
xfer += NBPG;
xfer += PAGE_SIZE;
++bzsc_cnt_dma3;
}
if (xfer != *len)

View File

@ -1,4 +1,4 @@
/* $NetBSD: bztzsc.c,v 1.19 2002/10/02 04:55:48 thorpej Exp $ */
/* $NetBSD: bztzsc.c,v 1.20 2003/04/01 21:26:29 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bztzsc.c,v 1.19 2002/10/02 04:55:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: bztzsc.c,v 1.20 2003/04/01 21:26:29 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -56,6 +56,8 @@ __KERNEL_RCSID(0, "$NetBSD: bztzsc.c,v 1.19 2002/10/02 04:55:48 thorpej Exp $");
#include <sys/user.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -359,7 +361,7 @@ bztzsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
bsc->sc_dmasize = bztzsc_max_dma;
ptr = *addr; /* Kernel virtual address */
pa = kvtop(ptr); /* Physical address of DMA */
xfer = min(bsc->sc_dmasize, NBPG - (pa & (NBPG - 1)));
xfer = min(bsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
bsc->sc_xfr_align = 0;
/*
* If output and unaligned, stuff odd byte into FIFO
@ -384,10 +386,10 @@ bztzsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
while (xfer < bsc->sc_dmasize) {
if ((pa + xfer) != kvtop(*addr + xfer))
break;
if ((bsc->sc_dmasize - xfer) < NBPG)
if ((bsc->sc_dmasize - xfer) < PAGE_SIZE)
xfer = bsc->sc_dmasize;
else
xfer += NBPG;
xfer += PAGE_SIZE;
++bztzsc_cnt_dma3;
}
if (xfer != *len)

View File

@ -1,4 +1,4 @@
/* $NetBSD: cbiisc.c,v 1.15 2002/10/02 04:55:49 thorpej Exp $ */
/* $NetBSD: cbiisc.c,v 1.16 2003/04/01 21:26:29 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cbiisc.c,v 1.15 2002/10/02 04:55:49 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: cbiisc.c,v 1.16 2003/04/01 21:26:29 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -50,6 +50,8 @@ __KERNEL_RCSID(0, "$NetBSD: cbiisc.c,v 1.15 2002/10/02 04:55:49 thorpej Exp $");
#include <sys/user.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -351,7 +353,7 @@ cbiisc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
csc->sc_dmasize = cbiisc_max_dma;
ptr = *addr; /* Kernel virtual address */
pa = kvtop(ptr); /* Physical address of DMA */
xfer = min(csc->sc_dmasize, NBPG - (pa & (NBPG - 1)));
xfer = min(csc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
csc->sc_xfr_align = 0;
/*
* If output and unaligned, stuff odd byte into FIFO
@ -376,10 +378,10 @@ cbiisc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
while (xfer < csc->sc_dmasize) {
if ((pa + xfer) != kvtop(*addr + xfer))
break;
if ((csc->sc_dmasize - xfer) < NBPG)
if ((csc->sc_dmasize - xfer) < PAGE_SIZE)
xfer = csc->sc_dmasize;
else
xfer += NBPG;
xfer += PAGE_SIZE;
++cbiisc_cnt_dma3;
}
if (xfer != *len)

View File

@ -1,4 +1,4 @@
/* $NetBSD: cbsc.c,v 1.16 2002/10/02 04:55:49 thorpej Exp $ */
/* $NetBSD: cbsc.c,v 1.17 2003/04/01 21:26:29 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cbsc.c,v 1.16 2002/10/02 04:55:49 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: cbsc.c,v 1.17 2003/04/01 21:26:29 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -50,6 +50,8 @@ __KERNEL_RCSID(0, "$NetBSD: cbsc.c,v 1.16 2002/10/02 04:55:49 thorpej Exp $");
#include <sys/user.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -358,7 +360,7 @@ cbsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
csc->sc_dmasize = cbsc_max_dma;
ptr = *addr; /* Kernel virtual address */
pa = kvtop(ptr); /* Physical address of DMA */
xfer = min(csc->sc_dmasize, NBPG - (pa & (NBPG - 1)));
xfer = min(csc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
csc->sc_xfr_align = 0;
/*
* If output and unaligned, stuff odd byte into FIFO
@ -383,10 +385,10 @@ cbsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
while (xfer < csc->sc_dmasize) {
if ((pa + xfer) != kvtop(*addr + xfer))
break;
if ((csc->sc_dmasize - xfer) < NBPG)
if ((csc->sc_dmasize - xfer) < PAGE_SIZE)
xfer = csc->sc_dmasize;
else
xfer += NBPG;
xfer += PAGE_SIZE;
++cbsc_cnt_dma3;
}
if (xfer != *len)

View File

@ -1,4 +1,4 @@
/* $NetBSD: drbbc.c,v 1.10 2002/10/02 04:55:49 thorpej Exp $ */
/* $NetBSD: drbbc.c,v 1.11 2003/04/01 21:26:31 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -37,12 +37,15 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: drbbc.c,v 1.10 2002/10/02 04:55:49 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: drbbc.c,v 1.11 2003/04/01 21:26:31 thorpej Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/systm.h>
#include <uvm/uvm_extern.h>
#if 0
#include <machine/psl.h>
#endif
@ -102,7 +105,7 @@ drbbc_attach(struct device *pdp, struct device *dp, void *auxp)
sc->sc_dsh.ds_read_bit = draco_ds_read_bit;
sc->sc_dsh.ds_write_bit = draco_ds_write_bit;
sc->sc_dsh.ds_reset = draco_ds_reset;
sc->sc_dsh.ds_hw_handle = (void *)(DRCCADDR + DRIOCTLPG*NBPG);
sc->sc_dsh.ds_hw_handle = (void *)(DRCCADDR + DRIOCTLPG*PAGE_SIZE);
sc->sc_dsh.ds_reset(sc->sc_dsh.ds_hw_handle);

View File

@ -1,4 +1,4 @@
/* $NetBSD: drsc.c,v 1.22 2002/10/02 04:55:49 thorpej Exp $ */
/* $NetBSD: drsc.c,v 1.23 2003/04/01 21:26:31 thorpej Exp $ */
/*
* Copyright (c) 1996 Ignatios Souvatzis
@ -38,12 +38,15 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: drsc.c,v 1.22 2002/10/02 04:55:49 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: drsc.c,v 1.23 2003/04/01 21:26:31 thorpej Exp $");
#include <sys/param.h>
#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>
@ -101,7 +104,7 @@ drscattach(struct device *pdp, struct device *dp, void *auxp)
zap = auxp;
sc->sc_siopp = rp = (siop_regmap_p)(DRCCADDR+NBPG*DRSCSIPG);
sc->sc_siopp = rp = (siop_regmap_p)(DRCCADDR+PAGE_SIZE*DRSCSIPG);
/*
* CTEST7 = TT1

View File

@ -1,4 +1,4 @@
/* $NetBSD: drsupio.c,v 1.14 2003/01/01 00:28:57 thorpej Exp $ */
/* $NetBSD: drsupio.c,v 1.15 2003/04/01 21:26:31 thorpej Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: drsupio.c,v 1.14 2003/01/01 00:28:57 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: drsupio.c,v 1.15 2003/04/01 21:26:31 thorpej Exp $");
/*
* DraCo multi-io chip bus space stuff
@ -50,6 +50,8 @@ __KERNEL_RCSID(0, "$NetBSD: drsupio.c,v 1.14 2003/01/01 00:28:57 thorpej Exp $")
#include <sys/systm.h>
#include <sys/param.h>
#include <uvm/uvm_extern.h>
#include <machine/bus.h>
#include <amiga/include/cpu.h>
@ -112,7 +114,7 @@ drsupioattach(struct device *parent, struct device *self, void *auxp)
if (parent)
printf("\n");
drsc->sc_bst.base = DRCCADDR + NBPG * DRSUPIOPG + 1;
drsc->sc_bst.base = DRCCADDR + PAGE_SIZE * DRSUPIOPG + 1;
drsc->sc_bst.absm = &amiga_bus_stride_4;
supa.supio_iot = &drsc->sc_bst;
@ -127,7 +129,7 @@ drsupioattach(struct device *parent, struct device *self, void *auxp)
}
drlptintack(0);
ioct = (struct drioct *)(DRCCADDR + NBPG * DRIOCTLPG);
ioct = (struct drioct *)(DRCCADDR + PAGE_SIZE * DRIOCTLPG);
ioct->io_status2 |= DRSTAT2_PARIRQENA;
}
@ -137,7 +139,7 @@ drlptintack(void *p)
struct drioct *ioct;
(void)p;
ioct = (struct drioct *)(DRCCADDR + NBPG * DRIOCTLPG);
ioct = (struct drioct *)(DRCCADDR + PAGE_SIZE * DRIOCTLPG);
ioct->io_parrst = 0; /* any value works */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: fd.c,v 1.58 2003/01/06 13:10:25 wiz Exp $ */
/* $NetBSD: fd.c,v 1.59 2003/04/01 21:26:31 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.58 2003/01/06 13:10:25 wiz Exp $");
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.59 2003/04/01 21:26:31 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -49,6 +49,9 @@ __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.58 2003/01/06 13:10:25 wiz Exp $");
#include <sys/dkbad.h>
#include <sys/proc.h>
#include <sys/conf.h>
#include <uvm/uvm_extern.h>
#include <machine/cpu.h>
#include <amiga/amiga/device.h>
#include <amiga/amiga/custom.h>
@ -866,10 +869,10 @@ fdsetdisklabel(struct fd_softc *sc, struct disklabel *lp)
* make sure selected partition is within bounds
* XXX on the second check, its to handle a bug in
* XXX the cluster routines as they require mutliples
* XXX of NBPG currently
* XXX of PAGE_SIZE currently
*/
if ((pp->p_offset + pp->p_size >= lp->d_secperunit) ||
(pp->p_frag * pp->p_fsize % NBPG))
(pp->p_frag * pp->p_fsize % PAGE_SIZE))
return(EINVAL);
done:
bcopy(lp, clp, sizeof(struct disklabel));

View File

@ -1,4 +1,4 @@
/* $NetBSD: flsc.c,v 1.31 2002/10/02 04:55:49 thorpej Exp $ */
/* $NetBSD: flsc.c,v 1.32 2003/04/01 21:26:31 thorpej Exp $ */
/*
* Copyright (c) 1997 Michael L. Hitch
@ -44,7 +44,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: flsc.c,v 1.31 2002/10/02 04:55:49 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: flsc.c,v 1.32 2003/04/01 21:26:31 thorpej Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -58,6 +58,8 @@ __KERNEL_RCSID(0, "$NetBSD: flsc.c,v 1.31 2002/10/02 04:55:49 thorpej Exp $");
#include <sys/user.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -517,7 +519,7 @@ flsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
fsc->sc_dmasize = flsc_max_dma;
ptr = *addr; /* Kernel virtual address */
pa = kvtop(ptr); /* Physical address of DMA */
xfer = min(fsc->sc_dmasize, NBPG - (pa & (NBPG - 1)));
xfer = min(fsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
fsc->sc_xfr_align = 0;
fsc->sc_piomode = 0;
fsc->sc_portbits &= ~FLSC_PB_DMA_BITS;
@ -582,10 +584,10 @@ flsc_dma_setup(struct ncr53c9x_softc *sc, caddr_t *addr, size_t *len,
while (xfer < fsc->sc_dmasize) {
if ((pa + xfer) != kvtop(*addr + xfer))
break;
if ((fsc->sc_dmasize - xfer) < NBPG)
if ((fsc->sc_dmasize - xfer) < PAGE_SIZE)
xfer = fsc->sc_dmasize;
else
xfer += NBPG;
xfer += PAGE_SIZE;
}
fsc->sc_dmasize = xfer;

View File

@ -1,4 +1,4 @@
/* $NetBSD: grfabs_cc.c,v 1.23 2002/03/13 20:33:35 jandberg Exp $ */
/* $NetBSD: grfabs_cc.c,v 1.24 2003/04/01 21:26:32 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -38,13 +38,15 @@
#include "opt_amigaccgrf.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: grfabs_cc.c,v 1.23 2002/03/13 20:33:35 jandberg Exp $");
__KERNEL_RCSID(0, "$NetBSD: grfabs_cc.c,v 1.24 2003/04/01 21:26:32 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/queue.h>
#include <uvm/uvm_extern.h>
#include <amiga/amiga/custom.h>
#include <amiga/amiga/cc.h>
@ -314,7 +316,7 @@ alloc_bitmap(u_short width, u_short height, u_short depth, u_short flags)
#endif
total_size = m68k_round_page(plane_size * depth) + /* for length */
(temp_size) + (array_size) + sizeof(bmap_t) +
NBPG; /* for alignment */
PAGE_SIZE; /* for alignment */
bm = alloc_chipmem(total_size);
if (bm) {
if (flags & BMF_CLEAR) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sbic.c,v 1.49 2002/09/27 15:35:40 provos Exp $ */
/* $NetBSD: sbic.c,v 1.50 2003/04/01 21:26:32 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -46,7 +46,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sbic.c,v 1.49 2002/09/27 15:35:40 provos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sbic.c,v 1.50 2003/04/01 21:26:32 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -315,10 +315,10 @@ sbic_load_ptrs(struct sbic_softc *dev, sbic_regmap_t regs, int target, int lun)
vaddr = acb->sc_kv.dc_addr;
count = acb->sc_kv.dc_count;
for(count = (NBPG - ((int)vaddr & PGOFSET));
for(count = (PAGE_SIZE - ((int)vaddr & PGOFSET));
count < acb->sc_kv.dc_count
&& (char*)kvtop(vaddr + count + 4) == paddr + count + 4;
count += NBPG);
count += PAGE_SIZE);
/* If it's all contiguous... */
if(count > acb->sc_kv.dc_count ) {
count = acb->sc_kv.dc_count;
@ -2520,7 +2520,7 @@ sbiccheckdmap(void *bp, u_long len, u_long mask)
while (len) {
phy_buf = kvtop(buffer);
if (len < (phy_len = NBPG - ((int) buffer & PGOFSET)))
if (len < (phy_len = PAGE_SIZE - ((int) buffer & PGOFSET)))
phy_len = len;
if (phy_buf & mask)
return(1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: siop.c,v 1.47 2002/02/24 15:20:05 is Exp $ */
/* $NetBSD: siop.c,v 1.48 2003/04/01 21:26:32 thorpej Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@ -46,7 +46,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.47 2002/02/24 15:20:05 is Exp $");
__KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.48 2003/04/01 21:26:32 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -55,6 +55,9 @@ __KERNEL_RCSID(0, "$NetBSD: siop.c,v 1.47 2002/02/24 15:20:05 is Exp $");
#include <sys/dkstat.h>
#include <sys/buf.h>
#include <sys/malloc.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -767,7 +770,7 @@ siop_start(struct siop_softc *sc, int target, int lun, u_char *cbuf, int clen,
dmaend = NULL;
while (count > 0) {
acb->ds.chain[nchain].databuf = (char *) kvtop (addr);
if (count < (tcount = NBPG - ((int) addr & PGOFSET)))
if (count < (tcount = PAGE_SIZE - ((int) addr & PGOFSET)))
tcount = count;
acb->ds.chain[nchain].datalen = tcount;
addr += tcount;

View File

@ -1,4 +1,4 @@
/* $NetBSD: siop2.c,v 1.19 2002/02/24 15:20:06 is Exp $ */
/* $NetBSD: siop2.c,v 1.20 2003/04/01 21:26:33 thorpej Exp $ */
/*
* Copyright (c) 1994,1998 Michael L. Hitch
@ -46,7 +46,7 @@
#include "opt_ddb.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: siop2.c,v 1.19 2002/02/24 15:20:06 is Exp $");
__KERNEL_RCSID(0, "$NetBSD: siop2.c,v 1.20 2003/04/01 21:26:33 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -55,6 +55,9 @@ __KERNEL_RCSID(0, "$NetBSD: siop2.c,v 1.19 2002/02/24 15:20:06 is Exp $");
#include <sys/dkstat.h>
#include <sys/buf.h>
#include <sys/malloc.h>
#include <uvm/uvm_extern.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
@ -820,7 +823,7 @@ siopng_start(struct siop_softc *sc, int target, int lun, u_char *cbuf,
dmaend = NULL;
while (count > 0) {
acb->ds.chain[nchain].databuf = (char *) kvtop (addr);
if (count < (tcount = NBPG - ((int) addr & PGOFSET)))
if (count < (tcount = PAGE_SIZE - ((int) addr & PGOFSET)))
tcount = count;
#if DEBUG_ONLY_IF_DESPERATE

View File

@ -1,4 +1,4 @@
/* $NetBSD: zbus.c,v 1.50 2003/01/01 00:16:46 thorpej Exp $ */
/* $NetBSD: zbus.c,v 1.51 2003/04/01 21:26:33 thorpej Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -31,11 +31,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.50 2003/01/01 00:16:46 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: zbus.c,v 1.51 2003/04/01 21:26:33 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
#include <sys/systm.h>
#include <uvm/uvm_extern.h>
#include <machine/cpu.h>
#include <machine/pte.h>
#include <amiga/amiga/cfdev.h>
@ -275,7 +278,8 @@ zbusattach(struct device *pdp, struct device *dp, void *auxp)
if (amiga_realconfig) {
if (ZTWOMEMADDR)
printf(": mem 0x%08lx-0x%08lx",
ZTWOMEMADDR, ZTWOMEMADDR + NBPG * NZTWOMEMPG - 1);
ZTWOMEMADDR,
ZTWOMEMADDR + PAGE_SIZE * NZTWOMEMPG - 1);
if (ZBUSAVAIL)
printf (": i/o size 0x%08x", ZBUSAVAIL);
printf("\n");