[haiku-commits] r37189 - haiku/trunk/src/system/kernel/arch/x86/paging/32bit

Author: bonefish
Date: 2010-06-21 15:41:23 +0200 (Mon, 21 Jun 2010)
New Revision: 37189
Changeset: http://dev.haiku-os.org/changeset/37189/haiku

Modified:
   
haiku/trunk/src/system/kernel/arch/x86/paging/32bit/X86VMTranslationMap32Bit.cpp
Log:
Use InvalidatePage() instead of playing with the invalidation cache by hand.


Modified: 
haiku/trunk/src/system/kernel/arch/x86/paging/32bit/X86VMTranslationMap32Bit.cpp
===================================================================
--- 
haiku/trunk/src/system/kernel/arch/x86/paging/32bit/X86VMTranslationMap32Bit.cpp
    2010-06-21 13:39:52 UTC (rev 37188)
+++ 
haiku/trunk/src/system/kernel/arch/x86/paging/32bit/X86VMTranslationMap32Bit.cpp
    2010-06-21 13:41:23 UTC (rev 37189)
@@ -255,10 +255,7 @@
                        // Note, that we only need to invalidate the address, 
if the
                        // accessed flags was set, since only then the entry 
could have been
                        // in any TLB.
-                       if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE)
-                               fInvalidPages[fInvalidPagesCount] = start;
-
-                       fInvalidPagesCount++;
+                       InvalidatePage(start);
                }
        }
 
@@ -309,11 +306,7 @@
                // Note, that we only need to invalidate the address, if the
                // accessed flags was set, since only then the entry could have 
been
                // in any TLB.
-               if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE)
-                       fInvalidPages[fInvalidPagesCount] = address;
-
-               fInvalidPagesCount++;
-
+               InvalidatePage(address);
                Flush();
 
                // NOTE: Between clearing the page table entry and Flush() other
@@ -385,10 +378,7 @@
                                // Note, that we only need to invalidate the 
address, if the
                                // accessed flags was set, since only then the 
entry could have
                                // been in any TLB.
-                               if (fInvalidPagesCount < 
PAGE_INVALIDATE_CACHE_SIZE)
-                                       fInvalidPages[fInvalidPagesCount] = 
start;
-
-                               fInvalidPagesCount++;
+                               InvalidatePage(start);
                        }
 
                        if (area->cache_type != CACHE_TYPE_DEVICE) {
@@ -528,12 +518,8 @@
                        if ((oldEntry & X86_PTE_ACCESSED) != 0) {
                                page->accessed = true;
 
-                               if (!deletingAddressSpace) {
-                                       if (fInvalidPagesCount < 
PAGE_INVALIDATE_CACHE_SIZE)
-                                               
fInvalidPages[fInvalidPagesCount] = address;
-
-                                       fInvalidPagesCount++;
-                               }
+                               if (!deletingAddressSpace)
+                                       InvalidatePage(address);
                        }
 
                        if ((oldEntry & X86_PTE_DIRTY) != 0)
@@ -720,10 +706,7 @@
                        // Note, that we only need to invalidate the address, 
if the
                        // accessed flag was set, since only then the entry 
could have been
                        // in any TLB.
-                       if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE)
-                               fInvalidPages[fInvalidPagesCount] = start;
-
-                       fInvalidPagesCount++;
+                       InvalidatePage(start);
                }
        }
 
@@ -760,13 +743,9 @@
 
        pinner.Unlock();
 
-       if ((oldEntry & flagsToClear) != 0) {
-               if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE)
-                       fInvalidPages[fInvalidPagesCount] = va;
+       if ((oldEntry & flagsToClear) != 0)
+               InvalidatePage(va);
 
-               fInvalidPagesCount++;
-       }
-
        return B_OK;
 }
 
@@ -834,11 +813,8 @@
                // Note, that we only need to invalidate the address, if the
                // accessed flags was set, since only then the entry could have 
been
                // in any TLB.
-               if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE)
-                       fInvalidPages[fInvalidPagesCount] = address;
+               InvalidatePage(address);
 
-               fInvalidPagesCount++;
-
                Flush();
 
                return true;


Other related posts:

  • » [haiku-commits] r37189 - haiku/trunk/src/system/kernel/arch/x86/paging/32bit - ingo_weinhold