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 Panic if access_type has bits not in prot.



details:   https://anonhg.NetBSD.org/src/rev/9d8284bf7385
branches:  trunk
changeset: 467780:9d8284bf7385
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Mon Mar 29 05:31:24 1999 +0000

description:
Panic if access_type has bits not in prot.

diffstat:

 sys/arch/alpha/alpha/pmap.c |  17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diffs (38 lines):

diff -r bc5d2b2ea44d -r 9d8284bf7385 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Mon Mar 29 05:12:39 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Mon Mar 29 05:31:24 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.87 1999/03/27 02:48:32 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.88 1999/03/29 05:31:24 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.87 1999/03/27 02:48:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.88 1999/03/29 05:31:24 mycroft Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1773,15 +1773,10 @@
        if (managed) {
                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;
+#ifdef DIAGNOSTIC
+               if (access_type & ~prot)
+                       panic("pmap_enter: access_type exceeds prot");
+#endif
                if (access_type & VM_PROT_WRITE)
                        pvh->pvh_attrs |= (PGA_REFERENCED|PGA_MODIFIED);
                else if (access_type & VM_PROT_ALL)



Home | Main Index | Thread Index | Old Index