Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/vax two changes to pmap_enter():



details:   https://anonhg.NetBSD.org/src/rev/0574f623801a
branches:  trunk
changeset: 499493:0574f623801a
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Nov 21 06:14:40 2000 +0000

description:
two changes to pmap_enter():
 - allow entry of the same mapping that's already there.
   this can happen with UBC.
 - if PMAP_CANFAIL, return failure rather than sleeping
   when we fail to allocate a ptp.

diffstat:

 sys/arch/vax/vax/pmap.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (36 lines):

diff -r 37aa6e7330b8 -r 0574f623801a sys/arch/vax/vax/pmap.c
--- a/sys/arch/vax/vax/pmap.c   Tue Nov 21 05:49:07 2000 +0000
+++ b/sys/arch/vax/vax/pmap.c   Tue Nov 21 06:14:40 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.90 2000/11/21 05:49:08 chs Exp $       */
+/*     $NetBSD: pmap.c,v 1.91 2000/11/21 06:14:40 chs Exp $       */
 /*
  * Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -720,6 +720,8 @@
                                pg = uvm_pagealloc(NULL, 0, NULL, 0);
                                if (pg != NULL)
                                        break;
+                               if (flags & PMAP_CANFAIL)
+                                       return (KERN_RESOURCE_SHORTAGE);
 
                                if (pmap == pmap_kernel())
                                        panic("pmap_enter: no free pages");
@@ -745,11 +747,12 @@
                RECURSEEND;
                return (KERN_SUCCESS);
        }
-#ifdef DIAGNOSTIC
-       /* No mapping change. Not allowed to happen. */
-       if (newpte == oldpte)
-               panic("pmap_enter onto myself");
-#endif
+
+       /* mapping unchanged? just return. */
+       if (newpte == oldpte) {
+               RECURSEEND;
+               return (KERN_SUCCESS);
+       }
 
        /* Changing mapping? */
        oldpte &= PG_FRAME;



Home | Main Index | Thread Index | Old Index