Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/uvm Pull up revisions 1.47-1.48 via patch (requeste...



details:   https://anonhg.NetBSD.org/src/rev/fc1c532b3b66
branches:  netbsd-1-5
changeset: 490539:fc1c532b3b66
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Thu Jan 25 21:05:04 2001 +0000

description:
Pull up revisions 1.47-1.48 via patch (requested by thorpej):
  Change PROT_EXEC handling. Clear it from the maxprot if the protection
  lacks it, after a failed udv_attach() and retry the udv_attach().

diffstat:

 sys/uvm/uvm_mmap.c |  17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r bd755a8e2629 -r fc1c532b3b66 sys/uvm/uvm_mmap.c
--- a/sys/uvm/uvm_mmap.c        Thu Jan 25 20:55:36 2001 +0000
+++ b/sys/uvm/uvm_mmap.c        Thu Jan 25 21:05:04 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_mmap.c,v 1.41 2000/05/23 02:19:20 enami Exp $      */
+/*     $NetBSD: uvm_mmap.c,v 1.41.4.1 2001/01/25 21:05:04 jhawk Exp $  */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -1193,8 +1193,19 @@
 
                } else {
                        uobj = udv_attach((void *) &vp->v_rdev,
-                           (flags & MAP_SHARED) ?
-                           maxprot : (maxprot & ~VM_PROT_WRITE), foff, size);
+                           (flags & MAP_SHARED) ? maxprot :
+                           (maxprot & ~VM_PROT_WRITE), foff, size);
+                       /*
+                        * XXX Some devices don't like to be mapped with
+                        * XXX PROT_EXEC, but we don't really have a
+                        * XXX better way of handling this, right now
+                        */
+                       if (uobj == NULL && (prot & PROT_EXEC) == 0) {
+                               maxprot &= ~VM_PROT_EXECUTE;
+                               uobj = udv_attach((void *) &vp->v_rdev,
+                                   (flags & MAP_SHARED) ? maxprot :
+                                   (maxprot & ~VM_PROT_WRITE), foff, size);
+                       }
                        advice = UVM_ADV_RANDOM;
                }
                



Home | Main Index | Thread Index | Old Index