[haiku-commits] r35476 - haiku/trunk/src/system/kernel/vm

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 15 Feb 2010 20:10:44 +0100 (CET)

Author: bonefish
Date: 2010-02-15 20:10:44 +0100 (Mon, 15 Feb 2010)
New Revision: 35476
Changeset: http://dev.haiku-os.org/changeset/35476/haiku

Modified:
   haiku/trunk/src/system/kernel/vm/VMTranslationMap.cpp
Log:
UnmapPage() requires the caller to deal with the debug page access marking,
so the fallback implementations of UnmapPages() and UnmapArea() need to do
that. Not relevant for x86.


Modified: haiku/trunk/src/system/kernel/vm/VMTranslationMap.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/VMTranslationMap.cpp       2010-02-15 
18:49:12 UTC (rev 35475)
+++ haiku/trunk/src/system/kernel/vm/VMTranslationMap.cpp       2010-02-15 
19:10:44 UTC (rev 35476)
@@ -40,8 +40,25 @@
 
        addr_t address = base;
        addr_t end = address + size;
+#if DEBUG_PAGE_ACCESS
+       for (; address != end; address += B_PAGE_SIZE) {
+               addr_t physicalAddress;
+               uint32 flags;
+               if (map->Query(address, &physicalAddress, &flags) == B_OK
+                       && (flags & PAGE_PRESENT) == 0) {
+                       vm_page* page = vm_lookup_page(physicalAddress / 
B_PAGE_SIZE);
+                       if (page != NULL) {
+                               DEBUG_PAGE_ACCESS_START(page);
+                               UnmapPage(area, address, updatePageQueue);
+                               DEBUG_PAGE_ACCESS_END(page);
+                       } else
+                               UnmapPage(area, address, updatePageQueue);
+               }
+       }
+#else
        for (; address != end; address += B_PAGE_SIZE)
                UnmapPage(area, address, updatePageQueue);
+#endif
 }
 
 
@@ -64,8 +81,25 @@
 {
        addr_t address = area->Base();
        addr_t end = address + area->Size();
+#if DEBUG_PAGE_ACCESS
+       for (; address != end; address += B_PAGE_SIZE) {
+               addr_t physicalAddress;
+               uint32 flags;
+               if (map->Query(address, &physicalAddress, &flags) == B_OK
+                       && (flags & PAGE_PRESENT) == 0) {
+                       vm_page* page = vm_lookup_page(physicalAddress / 
B_PAGE_SIZE);
+                       if (page != NULL) {
+                               DEBUG_PAGE_ACCESS_START(page);
+                               UnmapPage(area, address, true);
+                               DEBUG_PAGE_ACCESS_END(page);
+                       } else
+                               UnmapPage(area, address, true);
+               }
+       }
+#else
        for (; address != end; address += B_PAGE_SIZE)
                UnmapPage(area, address, true);
+#endif
 }
 
 


Other related posts: