summaryrefslogtreecommitdiff
path: root/sys/arch/sparc
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/sparc
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/sparc')
-rw-r--r--sys/arch/sparc/include/pmap.h8
-rw-r--r--sys/arch/sparc/sparc/autoconf.c5
-rw-r--r--sys/arch/sparc/sparc/machdep.c10
-rw-r--r--sys/arch/sparc/sparc/mem.c4
-rw-r--r--sys/arch/sparc/sparc/pmap.c17
-rw-r--r--sys/arch/sparc/sparc/vm_machdep.c16
6 files changed, 33 insertions, 27 deletions
diff --git a/sys/arch/sparc/include/pmap.h b/sys/arch/sparc/include/pmap.h
index 59354a85bcf..eeba342568e 100644
--- a/sys/arch/sparc/include/pmap.h
+++ b/sys/arch/sparc/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.10 1999/07/09 21:33:37 art Exp $ */
+/* $OpenBSD: pmap.h,v 1.11 1999/09/03 18:01:55 art Exp $ */
/* $NetBSD: pmap.h,v 1.30 1997/08/04 20:00:47 pk Exp $ */
/*
@@ -284,7 +284,7 @@ void pmap_clear_modify4_4c __P((paddr_t pa));
void pmap_clear_reference4_4c __P((paddr_t pa));
void pmap_copy_page4_4c __P((paddr_t, paddr_t));
void pmap_enter4_4c __P((pmap_t, vaddr_t, paddr_t, vm_prot_t,
- boolean_t));
+ boolean_t, vm_prot_t));
paddr_t pmap_extract4_4c __P((pmap_t, vaddr_t));
boolean_t pmap_is_modified4_4c __P((paddr_t pa));
boolean_t pmap_is_referenced4_4c __P((paddr_t pa));
@@ -301,7 +301,7 @@ void pmap_clear_modify4m __P((paddr_t pa));
void pmap_clear_reference4m __P((paddr_t pa));
void pmap_copy_page4m __P((paddr_t, paddr_t));
void pmap_enter4m __P((pmap_t, vaddr_t, paddr_t, vm_prot_t,
- boolean_t));
+ boolean_t, vm_prot_t));
paddr_t pmap_extract4m __P((pmap_t, vaddr_t));
boolean_t pmap_is_modified4m __P((paddr_t pa));
boolean_t pmap_is_referenced4m __P((paddr_t pa));
@@ -345,7 +345,7 @@ extern void (*pmap_clear_modify_p) __P((paddr_t pa));
extern void (*pmap_clear_reference_p) __P((paddr_t pa));
extern void (*pmap_copy_page_p) __P((paddr_t, paddr_t));
extern void (*pmap_enter_p) __P((pmap_t, vaddr_t, paddr_t,
- vm_prot_t, boolean_t));
+ vm_prot_t, boolean_t, vm_prot_t));
extern paddr_t (*pmap_extract_p) __P((pmap_t, vaddr_t));
extern boolean_t (*pmap_is_modified_p) __P((paddr_t pa));
extern boolean_t (*pmap_is_referenced_p) __P((paddr_t pa));
diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c
index a579bd430d5..68afc63f0d8 100644
--- a/sys/arch/sparc/sparc/autoconf.c
+++ b/sys/arch/sparc/sparc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.30 1999/03/17 22:56:24 deraadt Exp $ */
+/* $OpenBSD: autoconf.c,v 1.31 1999/09/03 18:01:57 art Exp $ */
/* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */
/*
@@ -361,7 +361,8 @@ bootstrap()
/* Map Interrupt Enable Register */
pmap_enter(pmap_kernel(), INTRREG_VA,
INT_ENABLE_REG_PHYSADR | PMAP_NC | PMAP_OBIO,
- VM_PROT_READ | VM_PROT_WRITE, 1);
+ VM_PROT_READ | VM_PROT_WRITE, 1,
+ VM_PROT_READ | VM_PROT_WRITE);
/* Disable all interrupts */
*((unsigned char *)INTRREG_VA) = 0;
}
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index 0264cba6162..94f0e43ea16 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.39 1999/08/24 09:54:55 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.40 1999/09/03 18:01:58 art Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -250,7 +250,8 @@ cpu_startup()
panic("cpu_startup: "
"not enough RAM for buffer cache");
pmap_enter(kernel_map->pmap, curbuf,
- VM_PAGE_TO_PHYS(pg), VM_PROT_ALL, TRUE);
+ VM_PAGE_TO_PHYS(pg), VM_PROT_READ | VM_PROT_WRITE,
+ TRUE, VM_PROT_READ | VM_PROT_WRITE);
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
}
@@ -386,7 +387,8 @@ cpu_startup()
* fix message buffer mapping, note phys addr of msgbuf is 0
*/
- pmap_enter(pmap_kernel(), MSGBUF_VA, 0x0, VM_PROT_READ|VM_PROT_WRITE, 1);
+ pmap_enter(pmap_kernel(), MSGBUF_VA, 0x0, VM_PROT_READ|VM_PROT_WRITE,
+ TRUE, VM_PROT_READ | VM_PROT_WRITE);
if (CPU_ISSUN4)
msgbufp = (struct msgbuf *)(MSGBUF_VA + 4096);
else
@@ -1082,7 +1084,7 @@ mapdev(phys, virt, offset, size)
do {
pmap_enter(pmap_kernel(), v, pa | pmtype | PMAP_NC,
- VM_PROT_READ | VM_PROT_WRITE, 1);
+ VM_PROT_READ | VM_PROT_WRITE, 1, 0);
v += PAGE_SIZE;
pa += PAGE_SIZE;
} while ((size -= PAGE_SIZE) > 0);
diff --git a/sys/arch/sparc/sparc/mem.c b/sys/arch/sparc/sparc/mem.c
index c92224798ad..c54ea77c0d7 100644
--- a/sys/arch/sparc/sparc/mem.c
+++ b/sys/arch/sparc/sparc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.6 1999/07/09 21:30:02 art Exp $ */
+/* $OpenBSD: mem.c,v 1.7 1999/09/03 18:01:59 art Exp $ */
/* $NetBSD: mem.c,v 1.13 1996/03/30 21:12:16 christos Exp $ */
/*
@@ -141,7 +141,7 @@ mmrw(dev, uio, flags)
}
pmap_enter(pmap_kernel(), (vaddr_t)vmmap,
trunc_page(pa), 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/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c
index f33e135cbea..1867c14bcff 100644
--- a/sys/arch/sparc/sparc/pmap.c
+++ b/sys/arch/sparc/sparc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.31 1999/08/20 09:30:55 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.32 1999/09/03 18:01:59 art Exp $ */
/* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */
/*
@@ -493,7 +493,7 @@ void (*pmap_clear_modify_p) __P((paddr_t pa));
void (*pmap_clear_reference_p) __P((paddr_t pa));
void (*pmap_copy_page_p) __P((paddr_t, paddr_t));
void (*pmap_enter_p) __P((pmap_t, vaddr_t, paddr_t, vm_prot_t,
- boolean_t));
+ boolean_t, vm_prot_t));
paddr_t (*pmap_extract_p) __P((pmap_t, vaddr_t));
boolean_t (*pmap_is_modified_p) __P((paddr_t pa));
boolean_t (*pmap_is_referenced_p) __P((paddr_t pa));
@@ -3588,7 +3588,8 @@ pass2:
/* Map this piece of pv_table[] */
for (va = sva; va < eva; va += PAGE_SIZE) {
pmap_enter(pmap_kernel(), va, pa,
- VM_PROT_READ|VM_PROT_WRITE, 1);
+ VM_PROT_READ|VM_PROT_WRITE, 1,
+ VM_PROT_READ|VM_PROT_WRITE);
pa += PAGE_SIZE;
}
bzero((caddr_t)sva, eva - sva);
@@ -3624,7 +3625,7 @@ pmap_map(va, pa, endpa, prot)
int pgsize = PAGE_SIZE;
while (pa < endpa) {
- pmap_enter(pmap_kernel(), va, pa, prot, 1);
+ pmap_enter(pmap_kernel(), va, pa, prot, 1, 0);
va += pgsize;
pa += pgsize;
}
@@ -5110,12 +5111,13 @@ out:
#if defined(SUN4) || defined(SUN4C)
void
-pmap_enter4_4c(pm, va, pa, prot, wired)
+pmap_enter4_4c(pm, va, pa, prot, wired, access_prot)
struct pmap *pm;
vaddr_t va;
paddr_t pa;
vm_prot_t prot;
int wired;
+ vm_prot_t access_prot;
{
struct pvlist *pv;
int pteproto, ctx;
@@ -5477,12 +5479,13 @@ printf("%s[%d]: pmap_enu: changing existing va(0x%x)=>pa entry\n",
*/
void
-pmap_enter4m(pm, va, pa, prot, wired)
+pmap_enter4m(pm, va, pa, prot, wired, access_prot)
struct pmap *pm;
vaddr_t va;
paddr_t pa;
vm_prot_t prot;
int wired;
+ vm_prot_t access_prot;
{
struct pvlist *pv;
int pteproto, ctx;
@@ -5996,7 +5999,7 @@ pmap_copy(dst_pmap, src_pmap, dst_addr, len, src_addr)
(pte & PPROT_WRITE)
? (VM_PROT_WRITE | VM_PROT_READ)
: VM_PROT_READ,
- 0);
+ 0, 0);
src_addr += NBPG;
dst_addr += NBPG;
}
diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c
index 19be99b222b..2830cfa2045 100644
--- a/sys/arch/sparc/sparc/vm_machdep.c
+++ b/sys/arch/sparc/sparc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.10 1999/08/17 10:32:18 niklas Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.11 1999/09/03 18:02:00 art Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */
/*
@@ -88,7 +88,8 @@ pagemove(from, to, size)
pmap_remove(pmap_kernel(),
(vaddr_t)from, (vaddr_t)from + PAGE_SIZE);
pmap_enter(pmap_kernel(),
- (vaddr_t)to, pa, VM_PROT_READ|VM_PROT_WRITE, 1);
+ (vaddr_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;
@@ -215,9 +216,9 @@ dvma_mapin(map, va, len, canwait)
pa |= PG_IOC;
#endif
#endif
- pmap_enter(pmap_kernel(), tva,
- pa | PMAP_NC,
- VM_PROT_READ|VM_PROT_WRITE, 1);
+ pmap_enter(pmap_kernel(), tva, pa | PMAP_NC,
+ VM_PROT_READ | VM_PROT_WRITE, 1,
+ 0);
}
tva += PAGE_SIZE;
@@ -306,9 +307,8 @@ vmapbuf(bp, sz)
* pmap_enter distributes this mapping to all
* contexts... maybe we should avoid this extra work
*/
- pmap_enter(pmap_kernel(), kva,
- pa | PMAP_NC,
- VM_PROT_READ|VM_PROT_WRITE, 1);
+ pmap_enter(pmap_kernel(), kva, pa | PMAP_NC,
+ VM_PROT_READ | VM_PROT_WRITE, 1, 0);
addr += PAGE_SIZE;
kva += PAGE_SIZE;