Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha/alpha Pay attention to "access_type" in pmap_...



details:   https://anonhg.NetBSD.org/src/rev/d5727acf1e5f
branches:  trunk
changeset: 467667:d5727acf1e5f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Mar 27 02:48:32 1999 +0000

description:
Pay attention to "access_type" in pmap_enter().

diffstat:

 sys/arch/alpha/alpha/pmap.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 5afa9ed5330d -r d5727acf1e5f sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Sat Mar 27 01:44:37 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Sat Mar 27 02:48:32 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.86 1999/03/26 23:41:26 mycroft Exp $ */
+/* $NetBSD: pmap.c,v 1.87 1999/03/27 02:48:32 thorpej 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.86 1999/03/26 23:41:26 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.87 1999/03/27 02:48:32 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1774,6 +1774,20 @@
                struct pv_head *pvh = pa_to_pvh(pa);
 
                /*
+                * An obvious question here is why a page would be entered in
+                * response to a fault, but with permissions less than those
+                * requested.  This can happen in the case of a copy-on-write
+                * page that's not currently mapped being accessed; the first
+                * fault will map the original page read-only, and another
+                * fault will be taken to do the copy and make it read-write.
+                */
+               access_type &= prot;
+               if (access_type & VM_PROT_WRITE)
+                       pvh->pvh_attrs |= (PGA_REFERENCED|PGA_MODIFIED);
+               else if (access_type & VM_PROT_ALL)
+                       pvh->pvh_attrs |= PGA_REFERENCED;
+
+               /*
                 * Set up referenced/modified emulation for new mapping.
                 */
                if ((pvh->pvh_attrs & PGA_REFERENCED) == 0)



Home | Main Index | Thread Index | Old Index