Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm uvm_unmap_remove: debug check to ensure that



details:   https://anonhg.NetBSD.org/src/rev/915279f51d43
branches:  trunk
changeset: 572393:915279f51d43
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sat Jan 01 21:12:59 2005 +0000

description:
uvm_unmap_remove: debug check to ensure that
unmapped regions doesn't have any remaining page mappings.

diffstat:

 sys/uvm/uvm_map.c |  22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r b85c2f0defbe -r 915279f51d43 sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Sat Jan 01 21:11:51 2005 +0000
+++ b/sys/uvm/uvm_map.c Sat Jan 01 21:12:59 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_map.c,v 1.176 2005/01/01 21:11:51 yamt Exp $       */
+/*     $NetBSD: uvm_map.c,v 1.177 2005/01/01 21:12:59 yamt Exp $       */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.176 2005/01/01 21:11:51 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.177 2005/01/01 21:12:59 yamt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -1947,6 +1947,24 @@
                        pmap_remove(map->pmap, entry->start, entry->end);
                }
 
+#if defined(DEBUG)
+               if ((entry->flags & UVM_MAP_KMAPENT) == 0) {
+
+                       /*
+                        * check if there's remaining mapping,
+                        * which is a bug in caller.
+                        */
+
+                       vaddr_t va;
+                       for (va = entry->start; va < entry->end;
+                           va += PAGE_SIZE) {
+                               if (pmap_extract(vm_map_pmap(map), va, NULL)) {
+                                       panic("uvm_unmap_remove: has mapping");
+                               }
+                       }
+               }
+#endif /* defined(DEBUG) */
+
                /*
                 * remove entry from map and put it on our list of entries
                 * that we've nuked.  then go to next entry.



Home | Main Index | Thread Index | Old Index