summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-09-03 18:02:30 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-09-03 18:02:30 +0000
commit2a4977388d8ca2cef9e73cd2e0bbdaef83b4a180 (patch)
treeccbef58b3ebc3a9038f61326e627ca943e3cb79e /sys/arch/mac68k
parent49aebb598146d4d57b680055b575b4923212427c (diff)
Change the pmap_enter api to pass down an argument that indicates
the access type that caused this mapping. This is to simplify pmaps with mod/ref emulation (none for the moment) and in some cases speed up pmap_is_{referenced,modified}. At the same time, clean up some mappings that had too high protection. XXX - the access type is incorrect in old vm, it's only used by uvm and MD code. The actual use of this in pmap_enter implementations is not in this commit.
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r--sys/arch/mac68k/dev/nubus.c5
-rw-r--r--sys/arch/mac68k/mac68k/bus_space.c4
-rw-r--r--sys/arch/mac68k/mac68k/machdep.c8
-rw-r--r--sys/arch/mac68k/mac68k/mem.c4
-rw-r--r--sys/arch/mac68k/mac68k/pmap.c18
-rw-r--r--sys/arch/mac68k/mac68k/trap.c5
-rw-r--r--sys/arch/mac68k/mac68k/vm_machdep.c5
7 files changed, 29 insertions, 20 deletions
diff --git a/sys/arch/mac68k/dev/nubus.c b/sys/arch/mac68k/dev/nubus.c
index aa959045288..e1cdf36c6ec 100644
--- a/sys/arch/mac68k/dev/nubus.c
+++ b/sys/arch/mac68k/dev/nubus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nubus.c,v 1.13 1999/04/24 06:39:40 downsj Exp $ */
+/* $OpenBSD: nubus.c,v 1.14 1999/09/03 18:01:09 art Exp $ */
/* $NetBSD: nubus.c,v 1.35 1997/04/22 20:20:32 scottr Exp $ */
/*
@@ -828,7 +828,8 @@ nubus_mapin(paddr, sz)
pmap_map((int)va, pa | pmt, pa + sz, VM_PROT_ALL);
#else
do {
- pmap_enter(pmap_kernel(), va, pa | pmt, VM_PROT_ALL, FALSE);
+ pmap_enter(pmap_kernel(), va, pa | pmt,
+ VM_PROT_READ|VM_PROT_WRITE, FALSE, 0);
va += NBPG;
pa += NBPG;
} while ((sz -= NBPG) > 0);
diff --git a/sys/arch/mac68k/mac68k/bus_space.c b/sys/arch/mac68k/mac68k/bus_space.c
index d73639eefd3..6e114b4c805 100644
--- a/sys/arch/mac68k/mac68k/bus_space.c
+++ b/sys/arch/mac68k/mac68k/bus_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_space.c,v 1.3 1999/04/24 06:39:41 downsj Exp $ */
+/* $OpenBSD: bus_space.c,v 1.4 1999/09/03 18:01:11 art Exp $ */
/* $NetBSD: bus_space.c,v 1.2 1998/04/24 05:27:24 scottr Exp $ */
/*-
@@ -186,7 +186,7 @@ bus_mem_add_mapping(bpa, size, flags, bshp)
for (; pa < endpa; pa += NBPG, va += NBPG) {
pmap_enter(pmap_kernel(), va, pa,
- VM_PROT_READ | VM_PROT_WRITE, TRUE);
+ VM_PROT_READ | VM_PROT_WRITE, TRUE, 0);
if (!(flags & BUS_SPACE_MAP_CACHEABLE))
pmap_changebit(pa, PG_CI, TRUE);
}
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c
index d8360f0934f..98a37234efb 100644
--- a/sys/arch/mac68k/mac68k/machdep.c
+++ b/sys/arch/mac68k/mac68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.62 1999/06/11 06:19:08 downsj Exp $ */
+/* $OpenBSD: machdep.c,v 1.63 1999/09/03 18:01:12 art Exp $ */
/* $NetBSD: machdep.c,v 1.134 1997/02/14 06:15:30 scottr Exp $ */
/*
@@ -312,7 +312,9 @@ cpu_startup(void)
*/
for (i = 0; i < btoc(sizeof(struct msgbuf)); i++)
pmap_enter(pmap_kernel(), (vm_offset_t) msgbufp,
- high[numranges - 1] + i * NBPG, VM_PROT_ALL, TRUE);
+ high[numranges - 1] + i * NBPG,
+ VM_PROT_READ|VM_PROT_WRITE, TRUE,
+ VM_PROT_READ|VM_PROT_WRITE);
msgbufmapped = 1;
/*
@@ -841,7 +843,7 @@ dumpsys()
maddr = h->ram_segs[seg].start;
}
pmap_enter(pmap_kernel(), (vm_offset_t)vmmap, maddr,
- VM_PROT_READ, TRUE);
+ VM_PROT_READ, TRUE, VM_PROT_READ);
error = (*dump)(dumpdev, blkno, vmmap, NBPG);
bad:
diff --git a/sys/arch/mac68k/mac68k/mem.c b/sys/arch/mac68k/mac68k/mem.c
index 9f5f831581f..006e78c9dd8 100644
--- a/sys/arch/mac68k/mac68k/mem.c
+++ b/sys/arch/mac68k/mac68k/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.7 1999/04/24 06:39:41 downsj Exp $ */
+/* $OpenBSD: mem.c,v 1.8 1999/09/03 18:01:14 art Exp $ */
/* $NetBSD: mem.c,v 1.11 1996/05/05 06:18:41 briggs Exp $ */
/*
@@ -133,7 +133,7 @@ mmrw(dev, uio, flags)
v = uio->uio_offset;
pmap_enter(pmap_kernel(), (vm_offset_t)vmmap,
trunc_page(v), uio->uio_rw == UIO_READ ?
- VM_PROT_READ : VM_PROT_WRITE, TRUE);
+ VM_PROT_READ : VM_PROT_WRITE, TRUE, 0);
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
error = uiomove((caddr_t)vmmap + o, c, uio);
diff --git a/sys/arch/mac68k/mac68k/pmap.c b/sys/arch/mac68k/mac68k/pmap.c
index e9d4115849f..b28c0676acc 100644
--- a/sys/arch/mac68k/mac68k/pmap.c
+++ b/sys/arch/mac68k/mac68k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.15 1999/07/18 18:00:05 deraadt Exp $ */
+/* $OpenBSD: pmap.c,v 1.16 1999/09/03 18:01:14 art Exp $ */
/* $NetBSD: pmap.c,v 1.28 1996/10/21 05:42:27 scottr Exp $ */
/*
@@ -634,7 +634,7 @@ pmap_map(va, spa, epa, prot)
#endif
while (spa < epa) {
- pmap_enter(pmap_kernel(), va, spa, prot, FALSE);
+ pmap_enter(pmap_kernel(), va, spa, prot, FALSE, 0);
va += NBPG;
spa += NBPG;
}
@@ -1059,12 +1059,13 @@ extern vm_offset_t tmp_vpages[];
* insert this page into the given map NOW.
*/
void
-pmap_enter(pmap, va, pa, prot, wired)
+pmap_enter(pmap, va, pa, prot, wired, access_type)
register pmap_t pmap;
vm_offset_t va;
register vm_offset_t pa;
vm_prot_t prot;
boolean_t wired;
+ vm_prot_t access_type;
{
register pt_entry_t *pte;
register int npte;
@@ -1458,7 +1459,8 @@ pmap_zero_page(phys)
printf("pmap_zero_page(%lx)\n", phys);
#endif
kva = (vm_offset_t) CADDR1;
- pmap_enter(pmap_kernel(), kva, phys, VM_PROT_READ|VM_PROT_WRITE, TRUE);
+ pmap_enter(pmap_kernel(), kva, phys, VM_PROT_READ|VM_PROT_WRITE, TRUE,
+ 0);
zeropage((caddr_t)kva);
pmap_remove_mapping(pmap_kernel(), kva, PT_ENTRY_NULL,
PRM_TFLUSH|PRM_CFLUSH);
@@ -1483,8 +1485,9 @@ pmap_copy_page(src, dst)
#endif
skva = (vm_offset_t) CADDR1;
dkva = (vm_offset_t) CADDR2;
- pmap_enter(pmap_kernel(), skva, src, VM_PROT_READ, TRUE);
- pmap_enter(pmap_kernel(), dkva, dst, VM_PROT_READ|VM_PROT_WRITE, TRUE);
+ pmap_enter(pmap_kernel(), skva, src, VM_PROT_READ, TRUE, 0);
+ pmap_enter(pmap_kernel(), dkva, dst, VM_PROT_READ|VM_PROT_WRITE, TRUE,
+ 0);
copypage((caddr_t)skva, (caddr_t)dkva);
/* CADDR1 and CADDR2 are virtually contiguous */
pmap_remove(pmap_kernel(), skva, skva + (2 * NBPG));
@@ -2137,7 +2140,8 @@ pmap_enter_ptpage(pmap, va)
kpt_used_list = kpt;
ptpa = kpt->kpt_pa;
bzero((caddr_t)kpt->kpt_va, NBPG);
- pmap_enter(pmap, va, ptpa, VM_PROT_DEFAULT, TRUE);
+ pmap_enter(pmap, va, ptpa, VM_PROT_DEFAULT, TRUE,
+ VM_PROT_DEFAULT);
#ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE)) {
int ix = pmap_ste(pmap, va) - pmap_ste(pmap, 0);
diff --git a/sys/arch/mac68k/mac68k/trap.c b/sys/arch/mac68k/mac68k/trap.c
index c6e735d3181..6fe475a6111 100644
--- a/sys/arch/mac68k/mac68k/trap.c
+++ b/sys/arch/mac68k/mac68k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.15 1999/01/11 05:11:37 millert Exp $ */
+/* $OpenBSD: trap.c,v 1.16 1999/09/03 18:01:15 art Exp $ */
/* $NetBSD: trap.c,v 1.46 1997/04/07 22:54:44 scottr Exp $ */
/*
@@ -710,7 +710,8 @@ writeback(fp, docachepush)
*/
if (docachepush) {
pmap_enter(pmap_kernel(), (vm_offset_t)vmmap,
- trunc_page(f->f_fa), VM_PROT_WRITE, TRUE);
+ trunc_page(f->f_fa), VM_PROT_WRITE, TRUE,
+ VM_PROT_WRITE);
fa = (u_int)&vmmap[(f->f_fa & PGOFSET) & ~0xF];
bcopy((caddr_t)&f->f_pd0, (caddr_t)fa, 16);
DCFL(pmap_extract(pmap_kernel(), (vm_offset_t)fa));
diff --git a/sys/arch/mac68k/mac68k/vm_machdep.c b/sys/arch/mac68k/mac68k/vm_machdep.c
index b4ac53a2855..9c3bec98e5f 100644
--- a/sys/arch/mac68k/mac68k/vm_machdep.c
+++ b/sys/arch/mac68k/mac68k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.12 1999/08/17 10:32:17 niklas Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.13 1999/09/03 18:01:15 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.21 1996/09/16 18:00:31 scottr Exp $ */
/*
@@ -264,7 +264,8 @@ pagemove(from, to, size)
pmap_remove(pmap_kernel(),
(vm_offset_t)from, (vm_offset_t) from + PAGE_SIZE);
pmap_enter(pmap_kernel(),
- (vm_offset_t)to, pa, VM_PROT_READ|VM_PROT_WRITE, 1);
+ (vm_offset_t)to, pa, VM_PROT_READ|VM_PROT_WRITE, 1,
+ VM_PROT_READ|VM_PROT_WRITE);
from += PAGE_SIZE;
to += PAGE_SIZE;
size -= PAGE_SIZE;