Use PAGE_SIZE rather than NBPG.
This commit is contained in:
parent
295e297794
commit
9f7d0893c1
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: if_le.c,v 1.27 2002/10/02 05:28:13 thorpej Exp $ */
|
/* $NetBSD: if_le.c,v 1.28 2003/04/02 02:19:29 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||||
@ -84,6 +84,8 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/device.h>
|
#include <sys/device.h>
|
||||||
|
|
||||||
|
#include <uvm/uvm_extern.h>
|
||||||
|
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <net/if_ether.h>
|
#include <net/if_ether.h>
|
||||||
#include <net/if_media.h>
|
#include <net/if_media.h>
|
||||||
@ -193,7 +195,7 @@ le_pcc_attach(parent, self, aux)
|
|||||||
bus_space_map(pa->pa_bust, pa->pa_offset, 4, 0, &lsc->sc_bush);
|
bus_space_map(pa->pa_bust, pa->pa_offset, 4, 0, &lsc->sc_bush);
|
||||||
|
|
||||||
/* Get contiguous DMA-able memory for the lance */
|
/* Get contiguous DMA-able memory for the lance */
|
||||||
if (bus_dmamem_alloc(pa->pa_dmat, ether_data_buff_size, NBPG, 0,
|
if (bus_dmamem_alloc(pa->pa_dmat, ether_data_buff_size, PAGE_SIZE, 0,
|
||||||
&seg, 1, &rseg,
|
&seg, 1, &rseg,
|
||||||
BUS_DMA_NOWAIT | BUS_DMA_ONBOARD_RAM | BUS_DMA_24BIT)) {
|
BUS_DMA_NOWAIT | BUS_DMA_ONBOARD_RAM | BUS_DMA_24BIT)) {
|
||||||
printf("%s: Failed to allocate ether buffer\n", self->dv_xname);
|
printf("%s: Failed to allocate ether buffer\n", self->dv_xname);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: sbic.c,v 1.19 2002/10/20 02:37:29 chs Exp $ */
|
/* $NetBSD: sbic.c,v 1.20 2003/04/02 02:19:29 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes Copyright (c) 1996 Steve Woodford
|
* Changes Copyright (c) 1996 Steve Woodford
|
||||||
@ -314,10 +314,10 @@ sbic_load_ptrs(dev)
|
|||||||
vaddr = acb->sc_kv.dc_addr;
|
vaddr = acb->sc_kv.dc_addr;
|
||||||
paddr = acb->sc_pa.dc_addr = (char *) kvtop((caddr_t)vaddr);
|
paddr = acb->sc_pa.dc_addr = (char *) kvtop((caddr_t)vaddr);
|
||||||
|
|
||||||
for (count = (NBPG - ((int)vaddr & PGOFSET));
|
for (count = (PAGE_SIZE - ((int)vaddr & PGOFSET));
|
||||||
count < acb->sc_kv.dc_count &&
|
count < acb->sc_kv.dc_count &&
|
||||||
(char*)kvtop((caddr_t)(vaddr + count + 4)) == paddr + count + 4;
|
(char*)kvtop((caddr_t)(vaddr + count + 4)) == paddr + count + 4;
|
||||||
count += NBPG)
|
count += PAGE_SIZE)
|
||||||
; /* Do nothing */
|
; /* Do nothing */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2546,7 +2546,7 @@ sbiccheckdmap(bp, len, mask)
|
|||||||
while ( len ) {
|
while ( len ) {
|
||||||
|
|
||||||
phy_buf = kvtop((caddr_t)buffer);
|
phy_buf = kvtop((caddr_t)buffer);
|
||||||
phy_len = NBPG - ((int) buffer & PGOFSET);
|
phy_len = PAGE_SIZE - ((int) buffer & PGOFSET);
|
||||||
|
|
||||||
if ( len < phy_len )
|
if ( len < phy_len )
|
||||||
phy_len = len;
|
phy_len = len;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: bus_dma.c,v 1.20 2002/06/02 14:44:37 drochner Exp $ */
|
/* $NetBSD: bus_dma.c,v 1.21 2003/04/02 02:19:29 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file was taken from from next68k/dev/bus_dma.c, which was originally
|
* This file was taken from from next68k/dev/bus_dma.c, which was originally
|
||||||
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
|
||||||
|
|
||||||
__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.20 2002/06/02 14:44:37 drochner Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.21 2003/04/02 02:19:29 thorpej Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
@ -183,7 +183,7 @@ _bus_dmamap_load_buffer_direct_common(t, map, buf, buflen, p, flags,
|
|||||||
/*
|
/*
|
||||||
* Compute the segment size, and adjust counts.
|
* Compute the segment size, and adjust counts.
|
||||||
*/
|
*/
|
||||||
sgsize = NBPG - ((u_long)vaddr & PGOFSET);
|
sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET);
|
||||||
if (buflen < sgsize)
|
if (buflen < sgsize)
|
||||||
sgsize = buflen;
|
sgsize = buflen;
|
||||||
|
|
||||||
@ -513,15 +513,15 @@ _bus_dmamap_sync_0460(t, map, offset, len, ops)
|
|||||||
e = (pe + 15) & ~0xf;
|
e = (pe + 15) & ~0xf;
|
||||||
|
|
||||||
/* flush cache line (060 too) */
|
/* flush cache line (060 too) */
|
||||||
while((p < e) && (p % NBPG)) {
|
while((p < e) && (p % PAGE_SIZE)) {
|
||||||
DCFL_40(p);
|
DCFL_40(p);
|
||||||
p += 16;
|
p += 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* flush page (060 too) */
|
/* flush page (060 too) */
|
||||||
while((p + NBPG) <= e) {
|
while((p + PAGE_SIZE) <= e) {
|
||||||
DCFP_40(p);
|
DCFP_40(p);
|
||||||
p += NBPG;
|
p += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* flush cache line (060 too) */
|
/* flush cache line (060 too) */
|
||||||
@ -553,17 +553,17 @@ _bus_dmamap_sync_0460(t, map, offset, len, ops)
|
|||||||
e = pe & ~0xf;
|
e = pe & ~0xf;
|
||||||
|
|
||||||
/* purge cache line */
|
/* purge cache line */
|
||||||
while((p < e) && (p % NBPG)) {
|
while((p < e) && (p % PAGE_SIZE)) {
|
||||||
DCPL_40(p);
|
DCPL_40(p);
|
||||||
ICPL_40(p);
|
ICPL_40(p);
|
||||||
p += 16;
|
p += 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* purge page */
|
/* purge page */
|
||||||
while((p + NBPG) <= e) {
|
while((p + PAGE_SIZE) <= e) {
|
||||||
DCPP_40(p);
|
DCPP_40(p);
|
||||||
ICPP_40(p);
|
ICPP_40(p);
|
||||||
p += NBPG;
|
p += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* purge cache line */
|
/* purge cache line */
|
||||||
@ -762,7 +762,7 @@ _bus_dmamem_map(t, segs, nsegs, size, kvap, flags)
|
|||||||
for (curseg = 0; curseg < nsegs; curseg++) {
|
for (curseg = 0; curseg < nsegs; curseg++) {
|
||||||
for (addr = segs[curseg]._ds_cpuaddr;
|
for (addr = segs[curseg]._ds_cpuaddr;
|
||||||
addr < (segs[curseg]._ds_cpuaddr + segs[curseg].ds_len);
|
addr < (segs[curseg]._ds_cpuaddr + segs[curseg].ds_len);
|
||||||
addr += NBPG, va += NBPG, size -= NBPG) {
|
addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) {
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
panic("_bus_dmamem_map: size botch");
|
panic("_bus_dmamem_map: size botch");
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: machdep.c,v 1.96 2003/01/17 23:42:05 thorpej Exp $ */
|
/* $NetBSD: machdep.c,v 1.97 2003/04/02 02:19:30 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988 University of Utah.
|
* Copyright (c) 1988 University of Utah.
|
||||||
@ -137,7 +137,7 @@ int safepri = PSL_LOWIPL;
|
|||||||
#ifndef ETHER_DATA_BUFF_PAGES
|
#ifndef ETHER_DATA_BUFF_PAGES
|
||||||
#define ETHER_DATA_BUFF_PAGES 4
|
#define ETHER_DATA_BUFF_PAGES 4
|
||||||
#endif
|
#endif
|
||||||
u_long ether_data_buff_size = ETHER_DATA_BUFF_PAGES * NBPG;
|
u_long ether_data_buff_size = ETHER_DATA_BUFF_PAGES * PAGE_SIZE;
|
||||||
u_char mvme_ea[6];
|
u_char mvme_ea[6];
|
||||||
|
|
||||||
extern u_int lowram;
|
extern u_int lowram;
|
||||||
@ -276,8 +276,8 @@ mvme68k_init()
|
|||||||
* Initialize error message buffer (at end of core).
|
* Initialize error message buffer (at end of core).
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < btoc(round_page(MSGBUFSIZE)); i++)
|
for (i = 0; i < btoc(round_page(MSGBUFSIZE)); i++)
|
||||||
pmap_enter(pmap_kernel(), (vaddr_t)msgbufaddr + i * NBPG,
|
pmap_enter(pmap_kernel(), (vaddr_t)msgbufaddr + i * PAGE_SIZE,
|
||||||
msgbufpa + i * NBPG, VM_PROT_READ|VM_PROT_WRITE,
|
msgbufpa + i * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE,
|
||||||
VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
|
VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
|
||||||
initmsgbuf(msgbufaddr, round_page(MSGBUFSIZE));
|
initmsgbuf(msgbufaddr, round_page(MSGBUFSIZE));
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
@ -509,7 +509,7 @@ cpu_startup()
|
|||||||
* "base" pages for the rest.
|
* "base" pages for the rest.
|
||||||
*/
|
*/
|
||||||
curbuf = (vaddr_t) buffers + (i * MAXBSIZE);
|
curbuf = (vaddr_t) buffers + (i * MAXBSIZE);
|
||||||
curbufsize = NBPG * ((i < residual) ? (base+1) : base);
|
curbufsize = PAGE_SIZE * ((i < residual) ? (base+1) : base);
|
||||||
|
|
||||||
while (curbufsize) {
|
while (curbufsize) {
|
||||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||||
@ -548,7 +548,7 @@ cpu_startup()
|
|||||||
#endif
|
#endif
|
||||||
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
|
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
|
||||||
printf("avail memory = %s\n", pbuf);
|
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);
|
printf("using %u buffers containing %s of memory\n", nbuf, pbuf);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -859,7 +859,7 @@ cpu_init_kcore_hdr()
|
|||||||
* Initialize the `dispatcher' portion of the header.
|
* Initialize the `dispatcher' portion of the header.
|
||||||
*/
|
*/
|
||||||
strcpy(h->name, machine);
|
strcpy(h->name, machine);
|
||||||
h->page_size = NBPG;
|
h->page_size = PAGE_SIZE;
|
||||||
h->kernbase = KERNBASE;
|
h->kernbase = KERNBASE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -972,7 +972,7 @@ long dumplo = 0; /* blocks */
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This is called by main to set dumplo and dumpsize.
|
* 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.
|
* in case there might be a disk label stored there.
|
||||||
* If there is extra space, put dump at the end to
|
* If there is extra space, put dump at the end to
|
||||||
* reduce the chance that swapping trashes it.
|
* reduce the chance that swapping trashes it.
|
||||||
@ -1079,8 +1079,8 @@ dumpsys()
|
|||||||
|
|
||||||
/* Limit size for next transfer. */
|
/* Limit size for next transfer. */
|
||||||
n = bytes - i;
|
n = bytes - i;
|
||||||
if (n > NBPG)
|
if (n > PAGE_SIZE)
|
||||||
n = NBPG;
|
n = PAGE_SIZE;
|
||||||
|
|
||||||
pmap_enter(pmap_kernel(), (vaddr_t)vmmap, maddr,
|
pmap_enter(pmap_kernel(), (vaddr_t)vmmap, maddr,
|
||||||
VM_PROT_READ, VM_PROT_READ|PMAP_WIRED);
|
VM_PROT_READ, VM_PROT_READ|PMAP_WIRED);
|
||||||
@ -1152,7 +1152,7 @@ initcpu()
|
|||||||
* VAC machines as it loses big time.
|
* VAC machines as it loses big time.
|
||||||
*/
|
*/
|
||||||
if (mappedcopysize == 0) {
|
if (mappedcopysize == 0) {
|
||||||
mappedcopysize = NBPG;
|
mappedcopysize = PAGE_SIZE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: mem.c,v 1.20 2002/10/23 09:11:39 jdolecek Exp $ */
|
/* $NetBSD: mem.c,v 1.21 2003/04/02 02:19:30 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988 University of Utah.
|
* Copyright (c) 1988 University of Utah.
|
||||||
@ -119,10 +119,10 @@ mmrw(dev, uio, flags)
|
|||||||
trunc_page(v), prot, prot|PMAP_WIRED);
|
trunc_page(v), prot, prot|PMAP_WIRED);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
o = uio->uio_offset & PGOFSET;
|
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);
|
error = uiomove((caddr_t)vmmap + o, c, uio);
|
||||||
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
|
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
|
||||||
(vaddr_t)vmmap + NBPG);
|
(vaddr_t)vmmap + PAGE_SIZE);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ mmrw(dev, uio, flags)
|
|||||||
extern caddr_t Segtabzero;
|
extern caddr_t Segtabzero;
|
||||||
devzeropage = Segtabzero;
|
devzeropage = Segtabzero;
|
||||||
}
|
}
|
||||||
c = min(iov->iov_len, NBPG);
|
c = min(iov->iov_len, PAGE_SIZE);
|
||||||
error = uiomove(devzeropage, c, uio);
|
error = uiomove(devzeropage, c, uio);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: pmap_bootstrap.c,v 1.18 2002/11/05 07:41:33 chs Exp $ */
|
/* $NetBSD: pmap_bootstrap.c,v 1.19 2003/04/02 02:19:30 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1991, 1993
|
* Copyright (c) 1991, 1993
|
||||||
@ -139,16 +139,16 @@ pmap_bootstrap(nextpa, firstpa)
|
|||||||
#endif
|
#endif
|
||||||
kstsize = 1;
|
kstsize = 1;
|
||||||
kstpa = nextpa;
|
kstpa = nextpa;
|
||||||
nextpa += kstsize * NBPG;
|
nextpa += kstsize * PAGE_SIZE;
|
||||||
kptpa = nextpa;
|
kptpa = nextpa;
|
||||||
nptpages = RELOC(Sysptsize, int) +
|
nptpages = RELOC(Sysptsize, int) +
|
||||||
(iiomappages + NPTEPG - 1) / NPTEPG;
|
(iiomappages + NPTEPG - 1) / NPTEPG;
|
||||||
nextpa += nptpages * NBPG;
|
nextpa += nptpages * PAGE_SIZE;
|
||||||
iiopa = nextpa - iiomappages * sizeof(pt_entry_t);
|
iiopa = nextpa - iiomappages * sizeof(pt_entry_t);
|
||||||
kptmpa = nextpa;
|
kptmpa = nextpa;
|
||||||
nextpa += NBPG;
|
nextpa += PAGE_SIZE;
|
||||||
lkptpa = nextpa;
|
lkptpa = nextpa;
|
||||||
nextpa += NBPG;
|
nextpa += PAGE_SIZE;
|
||||||
p0upa = nextpa;
|
p0upa = nextpa;
|
||||||
nextpa += USPACE;
|
nextpa += USPACE;
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ pmap_bootstrap(nextpa, firstpa)
|
|||||||
protopte = kptpa | PG_RW | PG_CI | PG_U | PG_V;
|
protopte = kptpa | PG_RW | PG_CI | PG_U | PG_V;
|
||||||
while (pte < epte) {
|
while (pte < epte) {
|
||||||
*pte++ = protopte;
|
*pte++ = protopte;
|
||||||
protopte += NBPG;
|
protopte += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Invalidate all but the last remaining entry.
|
* Invalidate all but the last remaining entry.
|
||||||
@ -278,8 +278,8 @@ pmap_bootstrap(nextpa, firstpa)
|
|||||||
while (pte < epte) {
|
while (pte < epte) {
|
||||||
*ste++ = protoste;
|
*ste++ = protoste;
|
||||||
*pte++ = protopte;
|
*pte++ = protopte;
|
||||||
protoste += NBPG;
|
protoste += PAGE_SIZE;
|
||||||
protopte += NBPG;
|
protopte += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Invalidate all but the last remaining entries in both.
|
* Invalidate all but the last remaining entries in both.
|
||||||
@ -322,7 +322,7 @@ pmap_bootstrap(nextpa, firstpa)
|
|||||||
protopte = firstpa | PG_RO | PG_U | PG_V;
|
protopte = firstpa | PG_RO | PG_U | PG_V;
|
||||||
while (pte < epte) {
|
while (pte < epte) {
|
||||||
*pte++ = protopte;
|
*pte++ = protopte;
|
||||||
protopte += NBPG;
|
protopte += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Validate PTEs for kernel data/bss, dynamic data allocated
|
* Validate PTEs for kernel data/bss, dynamic data allocated
|
||||||
@ -338,7 +338,7 @@ pmap_bootstrap(nextpa, firstpa)
|
|||||||
protopte |= PG_CCB;
|
protopte |= PG_CCB;
|
||||||
while (pte < epte) {
|
while (pte < epte) {
|
||||||
*pte++ = protopte;
|
*pte++ = protopte;
|
||||||
protopte += NBPG;
|
protopte += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* map the kernel segment table cache invalidated for
|
* map the kernel segment table cache invalidated for
|
||||||
@ -353,7 +353,7 @@ pmap_bootstrap(nextpa, firstpa)
|
|||||||
}
|
}
|
||||||
while (pte < epte) {
|
while (pte < epte) {
|
||||||
*pte++ = protopte;
|
*pte++ = protopte;
|
||||||
protopte += NBPG;
|
protopte += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Finally, validate the internal IO space PTEs (RW+CI).
|
* Finally, validate the internal IO space PTEs (RW+CI).
|
||||||
@ -363,7 +363,7 @@ pmap_bootstrap(nextpa, firstpa)
|
|||||||
protopte = RELOC(intiobase_phys, u_int) | PG_RW | PG_CI | PG_U | PG_V;
|
protopte = RELOC(intiobase_phys, u_int) | PG_RW | PG_CI | PG_U | PG_V;
|
||||||
while (pte < epte) {
|
while (pte < epte) {
|
||||||
*pte++ = protopte;
|
*pte++ = protopte;
|
||||||
protopte += NBPG;
|
protopte += PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -553,11 +553,11 @@ pmap_bootstrap(nextpa, firstpa)
|
|||||||
vaddr_t va = RELOC(virtual_avail, vaddr_t);
|
vaddr_t va = RELOC(virtual_avail, vaddr_t);
|
||||||
|
|
||||||
RELOC(CADDR1, caddr_t) = (caddr_t)va;
|
RELOC(CADDR1, caddr_t) = (caddr_t)va;
|
||||||
va += NBPG;
|
va += PAGE_SIZE;
|
||||||
RELOC(CADDR2, caddr_t) = (caddr_t)va;
|
RELOC(CADDR2, caddr_t) = (caddr_t)va;
|
||||||
va += NBPG;
|
va += PAGE_SIZE;
|
||||||
RELOC(vmmap, caddr_t) = (caddr_t)va;
|
RELOC(vmmap, caddr_t) = (caddr_t)va;
|
||||||
va += NBPG;
|
va += PAGE_SIZE;
|
||||||
RELOC(msgbufaddr, caddr_t) = (caddr_t)va;
|
RELOC(msgbufaddr, caddr_t) = (caddr_t)va;
|
||||||
va += m68k_round_page(MSGBUFSIZE);
|
va += m68k_round_page(MSGBUFSIZE);
|
||||||
RELOC(virtual_avail, vaddr_t) = va;
|
RELOC(virtual_avail, vaddr_t) = va;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: trap.c,v 1.64 2003/01/28 22:35:11 wiz Exp $ */
|
/* $NetBSD: trap.c,v 1.65 2003/04/02 02:19:30 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988 University of Utah.
|
* Copyright (c) 1988 University of Utah.
|
||||||
@ -790,7 +790,7 @@ writeback(fp, docachepush)
|
|||||||
(void) pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
|
(void) pmap_extract(pmap_kernel(), (vaddr_t)fa, &pa);
|
||||||
DCFL_40(pa);
|
DCFL_40(pa);
|
||||||
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
|
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
|
||||||
(vaddr_t)&vmmap[NBPG]);
|
(vaddr_t)&vmmap[PAGE_SIZE]);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
} else
|
} else
|
||||||
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
|
printf("WARNING: pid %d(%s) uid %d: CPUSH not done\n",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: aic.c,v 1.8 1997/08/27 11:24:03 bouyer Exp $ */
|
/* $NetBSD: aic.c,v 1.9 2003/04/02 02:24:14 thorpej Exp $ */
|
||||||
|
|
||||||
/* Written by Phil Nelson for the pc532. Used source with the following
|
/* Written by Phil Nelson for the pc532. Used source with the following
|
||||||
* copyrights as a model.
|
* copyrights as a model.
|
||||||
@ -59,6 +59,9 @@
|
|||||||
#include <sys/user.h>
|
#include <sys/user.h>
|
||||||
#include <sys/dkbad.h>
|
#include <sys/dkbad.h>
|
||||||
#include <sys/disklabel.h>
|
#include <sys/disklabel.h>
|
||||||
|
|
||||||
|
#include <uvm/uvm_extern.h>
|
||||||
|
|
||||||
#include <dev/scsipi/scsi_all.h>
|
#include <dev/scsipi/scsi_all.h>
|
||||||
#include <dev/scsipi/scsipi_all.h>
|
#include <dev/scsipi/scsipi_all.h>
|
||||||
#include <dev/scsipi/scsiconf.h>
|
#include <dev/scsipi/scsiconf.h>
|
||||||
@ -110,8 +113,8 @@ int aicattach(struct pc532_device *dvp)
|
|||||||
void aicminphys(struct buf *bp)
|
void aicminphys(struct buf *bp)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(bp->b_bcount > ((AIC_NSEG - 1) * NBPG))
|
if(bp->b_bcount > ((AIC_NSEG - 1) * PAGE_SIZE))
|
||||||
bp->b_bcount = ((AIC_NSEG - 1) * NBPG);
|
bp->b_bcount = ((AIC_NSEG - 1) * PAGE_SIZE);
|
||||||
minphys(bp);
|
minphys(bp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: ieee_handler.c,v 1.13 2002/05/26 07:37:08 simonb Exp $ */
|
/* $NetBSD: ieee_handler.c,v 1.14 2003/04/02 02:24:15 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IEEE floating point support for NS32081 and NS32381 fpus.
|
* IEEE floating point support for NS32081 and NS32381 fpus.
|
||||||
@ -83,7 +83,7 @@
|
|||||||
|
|
||||||
#ifdef MACH
|
#ifdef MACH
|
||||||
/* Mach only defines this if KERNEL, NetBSD defines it always */
|
/* Mach only defines this if KERNEL, NetBSD defines it always */
|
||||||
# define ns532_round_page(addr) (((addr) + NBPG - 1) & ~(NBPG - 1))
|
# define ns532_round_page(addr) (((addr) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: kgdb_machdep.c,v 1.8 2000/06/29 07:51:46 mrg Exp $ */
|
/* $NetBSD: kgdb_machdep.c,v 1.9 2003/04/02 02:24:15 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996 Matthias Pfaller.
|
* Copyright (c) 1996 Matthias Pfaller.
|
||||||
@ -61,7 +61,7 @@ kgdb_acc(va, len)
|
|||||||
pte = kvtopte(va);
|
pte = kvtopte(va);
|
||||||
if ((*pte & PG_V) == 0)
|
if ((*pte & PG_V) == 0)
|
||||||
return (0);
|
return (0);
|
||||||
va += NBPG;
|
va += PAGE_SIZE;
|
||||||
} while (va < last_va);
|
} while (va < last_va);
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: machdep.c,v 1.136 2003/01/21 20:50:43 kleink Exp $ */
|
/* $NetBSD: machdep.c,v 1.137 2003/04/02 02:24:16 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1996 Matthias Pfaller.
|
* Copyright (c) 1996 Matthias Pfaller.
|
||||||
@ -163,8 +163,8 @@ cpu_startup()
|
|||||||
|
|
||||||
/* msgbuf_paddr was init'd in pmap */
|
/* msgbuf_paddr was init'd in pmap */
|
||||||
for (i = 0; i < btoc(MSGBUFSIZE); i++)
|
for (i = 0; i < btoc(MSGBUFSIZE); i++)
|
||||||
pmap_kenter_pa(msgbuf_vaddr + i * NBPG,
|
pmap_kenter_pa(msgbuf_vaddr + i * PAGE_SIZE,
|
||||||
msgbuf_paddr + i * NBPG, VM_PROT_READ | VM_PROT_WRITE);
|
msgbuf_paddr + i * PAGE_SIZE, VM_PROT_READ | VM_PROT_WRITE);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
|
|
||||||
initmsgbuf((caddr_t)msgbuf_vaddr, round_page(MSGBUFSIZE));
|
initmsgbuf((caddr_t)msgbuf_vaddr, round_page(MSGBUFSIZE));
|
||||||
@ -212,7 +212,7 @@ cpu_startup()
|
|||||||
* "base" pages for the rest.
|
* "base" pages for the rest.
|
||||||
*/
|
*/
|
||||||
curbuf = (vaddr_t) buffers + (i * MAXBSIZE);
|
curbuf = (vaddr_t) buffers + (i * MAXBSIZE);
|
||||||
curbufsize = NBPG * ((i < residual) ? (base+1) : base);
|
curbufsize = PAGE_SIZE * ((i < residual) ? (base+1) : base);
|
||||||
|
|
||||||
while (curbufsize) {
|
while (curbufsize) {
|
||||||
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
pg = uvm_pagealloc(NULL, 0, NULL, 0);
|
||||||
@ -258,7 +258,7 @@ cpu_startup()
|
|||||||
|
|
||||||
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
|
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
|
||||||
printf("avail memory = %s\n", pbuf);
|
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);
|
printf("using %u buffers containing %s of memory\n", nbuf, pbuf);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -702,7 +702,7 @@ cpu_dump()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This is called by main to set dumplo and dumpsize.
|
* 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.
|
* in case there might be a disk label stored there.
|
||||||
* If there is extra space, put dump at the end to
|
* If there is extra space, put dump at the end to
|
||||||
* reduce the chance that swapping trashes it.
|
* reduce the chance that swapping trashes it.
|
||||||
@ -748,7 +748,7 @@ bad:
|
|||||||
/*
|
/*
|
||||||
* Dump the kernel's image to the swap partition.
|
* Dump the kernel's image to the swap partition.
|
||||||
*/
|
*/
|
||||||
#define BYTES_PER_DUMP NBPG /* must be a multiple of pagesize XXX small */
|
#define BYTES_PER_DUMP PAGE_SIZE /* must be a multiple of pagesize XXX small */
|
||||||
static vaddr_t dumpspace;
|
static vaddr_t dumpspace;
|
||||||
|
|
||||||
vaddr_t
|
vaddr_t
|
||||||
@ -896,8 +896,8 @@ alloc_pages(pages)
|
|||||||
int pages;
|
int pages;
|
||||||
{
|
{
|
||||||
paddr_t p = avail_start;
|
paddr_t p = avail_start;
|
||||||
avail_start += pages * NBPG;
|
avail_start += pages * PAGE_SIZE;
|
||||||
memset((caddr_t) p, 0, pages * NBPG);
|
memset((caddr_t) p, 0, pages * PAGE_SIZE);
|
||||||
return(p);
|
return(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -924,10 +924,10 @@ map(pd, virtual, physical, protection, size)
|
|||||||
}
|
}
|
||||||
if (physical != (paddr_t) -1) {
|
if (physical != (paddr_t) -1) {
|
||||||
pt[ix2] = (pt_entry_t) (physical | protection | PG_V);
|
pt[ix2] = (pt_entry_t) (physical | protection | PG_V);
|
||||||
physical += NBPG;
|
physical += PAGE_SIZE;
|
||||||
size -= NBPG;
|
size -= PAGE_SIZE;
|
||||||
} else {
|
} else {
|
||||||
size -= (PTES_PER_PTP - ix2) * NBPG;
|
size -= (PTES_PER_PTP - ix2) * PAGE_SIZE;
|
||||||
ix2 = PTES_PER_PTP - 1;
|
ix2 = PTES_PER_PTP - 1;
|
||||||
}
|
}
|
||||||
if (++ix2 == PTES_PER_PTP) {
|
if (++ix2 == PTES_PER_PTP) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: mem.c,v 1.33 2002/11/21 00:22:10 simonb Exp $ */
|
/* $NetBSD: mem.c,v 1.34 2003/04/02 02:24:16 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988 University of Utah.
|
* Copyright (c) 1988 University of Utah.
|
||||||
@ -113,10 +113,10 @@ mmrw(dev, uio, flags)
|
|||||||
trunc_page(v), prot, prot|PMAP_WIRED);
|
trunc_page(v), prot, prot|PMAP_WIRED);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
o = uio->uio_offset & PGOFSET;
|
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);
|
error = uiomove((caddr_t)vmmap + o, c, uio);
|
||||||
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
|
pmap_remove(pmap_kernel(), (vaddr_t)vmmap,
|
||||||
(vaddr_t)vmmap + NBPG);
|
(vaddr_t)vmmap + PAGE_SIZE);
|
||||||
pmap_update(pmap_kernel());
|
pmap_update(pmap_kernel());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -141,10 +141,10 @@ mmrw(dev, uio, flags)
|
|||||||
}
|
}
|
||||||
if (zeropage == NULL) {
|
if (zeropage == NULL) {
|
||||||
zeropage = (caddr_t)
|
zeropage = (caddr_t)
|
||||||
malloc(NBPG, M_TEMP, M_WAITOK);
|
malloc(PAGE_SIZE, M_TEMP, M_WAITOK);
|
||||||
memset(zeropage, 0, NBPG);
|
memset(zeropage, 0, PAGE_SIZE);
|
||||||
}
|
}
|
||||||
c = min(iov->iov_len, NBPG);
|
c = min(iov->iov_len, PAGE_SIZE);
|
||||||
error = uiomove(zeropage, c, uio);
|
error = uiomove(zeropage, c, uio);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: vm_machdep.c,v 1.53 2002/09/22 05:41:27 gmcgarry Exp $ */
|
/* $NetBSD: vm_machdep.c,v 1.54 2003/04/02 02:24:16 thorpej Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1996 Matthias Pfaller.
|
* Copyright (c) 1996 Matthias Pfaller.
|
||||||
@ -265,7 +265,7 @@ setredzone(pte, vaddr)
|
|||||||
/*
|
/*
|
||||||
* Move pages from one kernel virtual address to another.
|
* Move pages from one kernel virtual address to another.
|
||||||
* Both addresses are assumed to reside in the Sysmap,
|
* 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
|
void
|
||||||
pagemove(from, to, size)
|
pagemove(from, to, size)
|
||||||
@ -274,12 +274,12 @@ pagemove(from, to, size)
|
|||||||
{
|
{
|
||||||
register pt_entry_t *fpte, *tpte, ofpte, otpte;
|
register pt_entry_t *fpte, *tpte, ofpte, otpte;
|
||||||
|
|
||||||
if (size % NBPG)
|
if (size % PAGE_SIZE)
|
||||||
panic("pagemove");
|
panic("pagemove");
|
||||||
fpte = kvtopte((vaddr_t)from);
|
fpte = kvtopte((vaddr_t)from);
|
||||||
tpte = kvtopte((vaddr_t)to);
|
tpte = kvtopte((vaddr_t)to);
|
||||||
|
|
||||||
if (size <= NBPG * 16) {
|
if (size <= PAGE_SIZE * 16) {
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
otpte = *tpte;
|
otpte = *tpte;
|
||||||
ofpte = *fpte;
|
ofpte = *fpte;
|
||||||
@ -289,17 +289,17 @@ pagemove(from, to, size)
|
|||||||
tlbflush_entry((vaddr_t) to);
|
tlbflush_entry((vaddr_t) to);
|
||||||
if (ofpte & PG_V)
|
if (ofpte & PG_V)
|
||||||
tlbflush_entry((vaddr_t) from);
|
tlbflush_entry((vaddr_t) from);
|
||||||
from += NBPG;
|
from += PAGE_SIZE;
|
||||||
to += NBPG;
|
to += PAGE_SIZE;
|
||||||
size -= NBPG;
|
size -= PAGE_SIZE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
*tpte++ = *fpte;
|
*tpte++ = *fpte;
|
||||||
*fpte++ = 0;
|
*fpte++ = 0;
|
||||||
from += NBPG;
|
from += PAGE_SIZE;
|
||||||
to += NBPG;
|
to += PAGE_SIZE;
|
||||||
size -= NBPG;
|
size -= PAGE_SIZE;
|
||||||
}
|
}
|
||||||
tlbflush();
|
tlbflush();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user