Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Changes for modified pmap_enter() API:
details: https://anonhg.NetBSD.org/src/rev/96d2cb304056
branches: trunk
changeset: 467653:96d2cb304056
user: mycroft <mycroft%NetBSD.org@localhost>
date: Fri Mar 26 23:41:25 1999 +0000
description:
Changes for modified pmap_enter() API:
* Map the message buffer with access_type = VM_PROT_READ|VM_PROT_WRITE `just
because'.
* Map the file system buffers with access_type = VM_PROT_READ|VM_PROT_WRITE to
avoid possible problems with pagemove().
* Do not use VM_PROT_EXEC with either of the above.
* Map pages for /dev/mem with access_type = prot. Also, DO NOT use
pmap_kenter() for this, as we DO NOT want to lose modification information.
* Map pages in dumpsys() with VM_PROT_READ.
* Map pages in m68k mappedcopyin()/mappedcopyout() and writeback() with
access_type = prot.
* For now, bus_dma*(), pmap_map(), vmapbuf(), and similar functions still use
access_type = 0. This should probably be revisited.
diffstat:
sys/arch/alpha/alpha/machdep.c | 7 ++++---
sys/arch/alpha/alpha/pmap.c | 7 ++++---
sys/arch/alpha/alpha/vm_machdep.c | 6 +++---
sys/arch/alpha/common/bus_dma.c | 6 +++---
sys/arch/amiga/amiga/machdep.c | 8 +++++---
sys/arch/amiga/amiga/mem.c | 8 +++++---
sys/arch/amiga/amiga/pmap.c | 7 ++++---
sys/arch/amiga/amiga/vm_machdep.c | 7 ++++---
sys/arch/arm32/arm32/mem.c | 8 +++++---
sys/arch/atari/atari/bus.c | 6 +++---
sys/arch/atari/atari/machdep.c | 8 +++++---
sys/arch/atari/atari/mem.c | 10 ++++++----
sys/arch/atari/atari/pmap.c | 5 +++--
sys/arch/atari/atari/trap.c | 5 +++--
sys/arch/atari/atari/vm_machdep.c | 7 ++++---
sys/arch/bebox/bebox/bus_dma.c | 4 ++--
sys/arch/bebox/bebox/machdep.c | 12 +++++++-----
sys/arch/hp300/hp300/leds.c | 4 ++--
sys/arch/hp300/hp300/machdep.c | 12 +++++++-----
sys/arch/hp300/hp300/mem.c | 10 ++++++----
sys/arch/hp300/hp300/pmap.c | 7 ++++---
sys/arch/hp300/hp300/trap.c | 5 +++--
sys/arch/hp300/hp300/vm_machdep.c | 7 ++++---
sys/arch/i386/i386/machdep.c | 27 ++++++++++++++++-----------
sys/arch/i386/i386/mem.c | 21 ++++++---------------
sys/arch/i386/i386/pmap.c | 7 ++++---
sys/arch/i386/i386/pmap.new.c | 7 ++++---
sys/arch/m68k/m68k/mappedcopy.c | 7 ++++---
sys/arch/mac68k/mac68k/bus_space.c | 4 ++--
sys/arch/mac68k/mac68k/machdep.c | 8 +++++---
sys/arch/mac68k/mac68k/mem.c | 10 ++++++----
sys/arch/mac68k/mac68k/pmap.c | 7 ++++---
sys/arch/mac68k/mac68k/trap.c | 5 +++--
sys/arch/mac68k/mac68k/vm_machdep.c | 7 ++++---
sys/arch/macppc/macppc/bus_dma.c | 4 ++--
sys/arch/macppc/macppc/machdep.c | 10 ++++++----
sys/arch/mips/mips/pmap.c | 7 ++++---
sys/arch/mvme68k/mvme68k/machdep.c | 10 ++++++----
sys/arch/mvme68k/mvme68k/mem.c | 10 ++++++----
sys/arch/mvme68k/mvme68k/pmap.c | 7 ++++---
sys/arch/mvme68k/mvme68k/trap.c | 5 +++--
sys/arch/mvme68k/mvme68k/vm_machdep.c | 7 ++++---
sys/arch/newsmips/newsmips/machdep.c | 7 ++++---
sys/arch/next68k/dev/bus_dma.c | 6 +++---
sys/arch/next68k/next68k/machdep.c | 10 ++++++----
sys/arch/next68k/next68k/mem.c | 10 ++++++----
sys/arch/next68k/next68k/pmap.c | 7 ++++---
sys/arch/next68k/next68k/trap.c | 5 +++--
sys/arch/next68k/next68k/vm_machdep.c | 7 ++++---
sys/arch/ofppc/ofppc/machdep.c | 5 +++--
sys/arch/pc532/pc532/machdep.c | 8 +++++---
sys/arch/pc532/pc532/mem.c | 21 ++++++---------------
sys/arch/pc532/pc532/pmap.c | 7 ++++---
sys/arch/pc532/pc532/pmap.new.c | 7 ++++---
sys/arch/pica/pica/pmap.c | 5 +++--
sys/arch/pica/pica/vm_machdep.c | 4 ++--
sys/arch/pmax/pmax/bus_dma.c | 4 ++--
sys/arch/pmax/pmax/machdep.c | 7 ++++---
sys/arch/powerpc/powerpc/pmap.c | 5 +++--
sys/arch/powerpc/powerpc/vm_machdep.c | 6 +++---
sys/arch/sparc/dev/if_ie_obio.c | 6 +++---
sys/arch/sparc/dev/vme_machdep.c | 8 ++++----
sys/arch/sparc/include/pmap.h | 14 +++++++-------
sys/arch/sparc/sparc/autoconf.c | 7 ++++---
sys/arch/sparc/sparc/cpu.c | 4 ++--
sys/arch/sparc/sparc/iommu.c | 4 ++--
sys/arch/sparc/sparc/machdep.c | 15 ++++++++-------
sys/arch/sparc/sparc/mem.c | 12 +++++++-----
sys/arch/sparc/sparc/pmap.c | 21 ++++++++++++---------
sys/arch/sparc/sparc/vm_machdep.c | 7 ++++---
sys/arch/sparc64/dev/sbus.c | 4 ++--
sys/arch/sparc64/sparc64/machdep.c | 9 +++++----
sys/arch/sparc64/sparc64/mem.c | 10 ++++++----
sys/arch/sparc64/sparc64/pmap.c | 5 +++--
sys/arch/sparc64/sparc64/vm_machdep.c | 7 ++++---
sys/arch/sun3/sun3/machdep.c | 7 ++++---
sys/arch/sun3/sun3/mem.c | 10 ++++++----
sys/arch/sun3/sun3/pmap.c | 7 ++++---
sys/arch/sun3/sun3/vm_machdep.c | 15 ++++++---------
sys/arch/sun3/sun3x/bus_subr.c | 4 ++--
sys/arch/sun3/sun3x/dvma.c | 4 ++--
sys/arch/sun3/sun3x/machdep.c | 7 ++++---
sys/arch/sun3/sun3x/mem.c | 10 ++++++----
sys/arch/sun3/sun3x/pmap.c | 8 +++++---
sys/arch/vax/vax/bus_mem.c | 4 ++--
sys/arch/vax/vax/machdep.c | 5 +++--
sys/arch/vax/vax/pmap.c | 5 +++--
sys/arch/vax/vax/vm_machdep.c | 4 ++--
sys/arch/x68k/x68k/bus.c | 4 ++--
sys/arch/x68k/x68k/machdep.c | 14 ++++++++------
sys/arch/x68k/x68k/mem.c | 10 ++++++----
sys/arch/x68k/x68k/pmap.c | 7 ++++---
sys/arch/x68k/x68k/trap.c | 5 +++--
sys/arch/x68k/x68k/vm_machdep.c | 7 ++++---
94 files changed, 407 insertions(+), 330 deletions(-)
diffs (truncated from 2812 to 300 lines):
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/alpha/alpha/machdep.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.164 1999/03/26 00:15:04 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.165 1999/03/26 23:41:25 mycroft Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.164 1999/03/26 00:15:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.165 1999/03/26 23:41:25 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1064,7 +1064,8 @@
pmap_kenter_pgs(curbuf, &pg, 1);
#else
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);
#endif
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.85 1999/03/26 00:15:04 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.86 1999/03/26 23:41:26 mycroft Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.85 1999/03/26 00:15:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.86 1999/03/26 23:41:26 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1560,12 +1560,13 @@
* 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)
pmap_t pmap;
vaddr_t va;
paddr_t pa;
vm_prot_t prot;
boolean_t wired;
+ vm_prot_t access_type;
{
boolean_t managed;
pt_entry_t *pte, npte;
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/alpha/alpha/vm_machdep.c
--- a/sys/arch/alpha/alpha/vm_machdep.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/alpha/alpha/vm_machdep.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.44 1999/03/24 05:50:51 mrg Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.45 1999/03/26 23:41:26 mycroft Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.44 1999/03/24 05:50:51 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.45 1999/03/26 23:41:26 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -402,7 +402,7 @@
if (pa == 0)
panic("vmapbuf: null page frame");
pmap_enter(vm_map_pmap(phys_map), taddr, trunc_page(pa),
- VM_PROT_READ|VM_PROT_WRITE, TRUE);
+ VM_PROT_READ|VM_PROT_WRITE, TRUE, 0);
faddr += PAGE_SIZE;
taddr += PAGE_SIZE;
}
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/alpha/common/bus_dma.c
--- a/sys/arch/alpha/common/bus_dma.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/alpha/common/bus_dma.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.28 1999/03/24 05:50:52 mrg Exp $ */
+/* $NetBSD: bus_dma.c,v 1.29 1999/03/26 23:41:27 mycroft Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.28 1999/03/24 05:50:52 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.29 1999/03/26 23:41:27 mycroft Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -588,7 +588,7 @@
pmap_kenter_pa(va, addr, VM_PROT_READ | VM_PROT_WRITE);
#else
pmap_enter(pmap_kernel(), va, addr,
- VM_PROT_READ | VM_PROT_WRITE, TRUE);
+ VM_PROT_READ | VM_PROT_WRITE, TRUE, 0);
#endif
}
}
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/amiga/amiga/machdep.c
--- a/sys/arch/amiga/amiga/machdep.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/amiga/amiga/machdep.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.131 1999/03/24 05:50:52 mrg Exp $ */
+/* $NetBSD: machdep.c,v 1.132 1999/03/26 23:41:27 mycroft Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -280,7 +280,8 @@
for (i = 0; i < btoc(MSGBUFSIZE); i++)
pmap_enter(pmap_kernel(), (vm_offset_t)msgbufaddr + i * NBPG,
- msgbufpa + i * NBPG, VM_PROT_ALL, TRUE);
+ msgbufpa + i * NBPG, VM_PROT_READ|VM_PROT_WRITE, TRUE,
+ VM_PROT_READ|VM_PROT_WRITE);
initmsgbuf(msgbufaddr, m68k_round_page(MSGBUFSIZE));
/*
@@ -413,7 +414,8 @@
pmap_kenter_pgs(curbuf, &pg, 1);
#else
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);
#endif
curbuf += PAGE_SIZE;
curbufsize -= PAGE_SIZE;
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/amiga/amiga/mem.c
--- a/sys/arch/amiga/amiga/mem.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/amiga/amiga/mem.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mem.c,v 1.23 1999/03/24 05:50:52 mrg Exp $ */
+/* $NetBSD: mem.c,v 1.24 1999/03/26 23:41:27 mycroft Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -102,6 +102,7 @@
register struct iovec *iov;
int error = 0;
static int physlock;
+ vm_prot_t prot;
if (minor(dev) == 0) {
/* lock against other uses of shared vmmap */
@@ -135,9 +136,10 @@
goto unlock;
}
#endif
+ prot = uio->uio_rw == UIO_READ ? VM_PROT_READ :
+ VM_PROT_WRITE;
pmap_enter(pmap_kernel(), (vm_offset_t)vmmap,
- trunc_page(v), uio->uio_rw == UIO_READ ?
- VM_PROT_READ : VM_PROT_WRITE, TRUE);
+ trunc_page(v), prot, TRUE, prot);
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
error = uiomove((caddr_t)vmmap + o, c, uio);
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/amiga/amiga/pmap.c
--- a/sys/arch/amiga/amiga/pmap.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/amiga/amiga/pmap.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.60 1999/03/24 05:50:53 mrg Exp $ */
+/* $NetBSD: pmap.c,v 1.61 1999/03/26 23:41:27 mycroft Exp $ */
/*
* Copyright (c) 1991 Regents of the University of California.
@@ -798,7 +798,7 @@
printf("pmap_map(%lx, %lx, %lx, %x)\n", virt, start, end, prot);
#endif
while (start < end) {
- pmap_enter(pmap_kernel(), virt, start, prot, FALSE);
+ pmap_enter(pmap_kernel(), virt, start, prot, FALSE, 0);
virt += PAGE_SIZE;
start += PAGE_SIZE;
}
@@ -1326,12 +1326,13 @@
extern int kernel_copyback;
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 u_int *pte;
register int npte;
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/amiga/amiga/vm_machdep.c
--- a/sys/arch/amiga/amiga/vm_machdep.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/amiga/amiga/vm_machdep.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.41 1999/03/24 05:50:53 mrg Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.42 1999/03/26 23:41:27 mycroft Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -177,7 +177,8 @@
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;
@@ -369,7 +370,7 @@
pa = pmap_extract(upmap, uva);
if (pa == 0)
panic("vmapbuf: null page frame");
- pmap_enter(kpmap, kva, pa, VM_PROT_READ|VM_PROT_WRITE, TRUE);
+ pmap_enter(kpmap, kva, pa, VM_PROT_READ|VM_PROT_WRITE, TRUE, 0);
uva += PAGE_SIZE;
kva += PAGE_SIZE;
len -= PAGE_SIZE;
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/arm32/arm32/mem.c
--- a/sys/arch/arm32/arm32/mem.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/arm32/arm32/mem.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mem.c,v 1.10 1999/03/26 22:00:25 mycroft Exp $ */
+/* $NetBSD: mem.c,v 1.11 1999/03/26 23:41:28 mycroft Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -95,6 +95,7 @@
register int c;
register struct iovec *iov;
int error = 0;
+ vm_prot_t prot;
if (minor(dev) == 0) {
/* lock against other uses of shared vmmap */
@@ -121,9 +122,10 @@
/* minor device 0 is physical memory */
case 0:
v = uio->uio_offset;
+ prot = uio->uio_rw == UIO_READ ? VM_PROT_READ :
+ VM_PROT_WRITE;
pmap_enter(pmap_kernel(), (vm_offset_t)memhook,
- trunc_page(v), uio->uio_rw == UIO_READ ?
- VM_PROT_READ : VM_PROT_WRITE, TRUE, 0);
+ trunc_page(v), prot, TRUE, prot);
o = uio->uio_offset & PGOFSET;
c = min(uio->uio_resid, (int)(NBPG - o));
error = uiomove((caddr_t)memhook + o, c, uio);
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/atari/atari/bus.c
--- a/sys/arch/atari/atari/bus.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/atari/atari/bus.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus.c,v 1.12 1999/03/24 05:50:57 mrg Exp $ */
+/* $NetBSD: bus.c,v 1.13 1999/03/26 23:41:28 mycroft Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@
for(; pa < endpa; pa += NBPG, va += NBPG) {
pmap_enter(pmap_kernel(), (vaddr_t)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);
}
@@ -505,7 +505,7 @@
VM_PROT_READ | VM_PROT_WRITE);
#else
pmap_enter(pmap_kernel(), va, addr - offset,
- VM_PROT_READ | VM_PROT_WRITE, TRUE);
+ VM_PROT_READ | VM_PROT_WRITE, TRUE, 0);
#endif
}
}
diff -r 958f27cadc7b -r 96d2cb304056 sys/arch/atari/atari/machdep.c
--- a/sys/arch/atari/atari/machdep.c Fri Mar 26 23:37:27 1999 +0000
+++ b/sys/arch/atari/atari/machdep.c Fri Mar 26 23:41:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.77 1999/03/24 05:50:58 mrg Exp $ */
+/* $NetBSD: machdep.c,v 1.78 1999/03/26 23:41:28 mycroft Exp $ */
/*
Home |
Main Index |
Thread Index |
Old Index