Use InvalidatePage() instead of playing with the invalidation cache by hand.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37189 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-06-21 13:41:23 +00:00
parent c6f52e8328
commit 66f9974b06
@@ -255,10 +255,7 @@ restart:
// Note, that we only need to invalidate the address, if the // Note, that we only need to invalidate the address, if the
// accessed flags was set, since only then the entry could have been // accessed flags was set, since only then the entry could have been
// in any TLB. // in any TLB.
if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE) InvalidatePage(start);
fInvalidPages[fInvalidPagesCount] = start;
fInvalidPagesCount++;
} }
} }
@@ -309,11 +306,7 @@ X86VMTranslationMap32Bit::UnmapPage(VMArea* area, addr_t address,
// Note, that we only need to invalidate the address, if the // Note, that we only need to invalidate the address, if the
// accessed flags was set, since only then the entry could have been // accessed flags was set, since only then the entry could have been
// in any TLB. // in any TLB.
if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE) InvalidatePage(address);
fInvalidPages[fInvalidPagesCount] = address;
fInvalidPagesCount++;
Flush(); Flush();
// NOTE: Between clearing the page table entry and Flush() other // NOTE: Between clearing the page table entry and Flush() other
@@ -385,10 +378,7 @@ X86VMTranslationMap32Bit::UnmapPages(VMArea* area, addr_t base, size_t size,
// Note, that we only need to invalidate the address, if the // Note, that we only need to invalidate the address, if the
// accessed flags was set, since only then the entry could have // accessed flags was set, since only then the entry could have
// been in any TLB. // been in any TLB.
if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE) InvalidatePage(start);
fInvalidPages[fInvalidPagesCount] = start;
fInvalidPagesCount++;
} }
if (area->cache_type != CACHE_TYPE_DEVICE) { if (area->cache_type != CACHE_TYPE_DEVICE) {
@@ -528,12 +518,8 @@ X86VMTranslationMap32Bit::UnmapArea(VMArea* area, bool deletingAddressSpace,
if ((oldEntry & X86_PTE_ACCESSED) != 0) { if ((oldEntry & X86_PTE_ACCESSED) != 0) {
page->accessed = true; page->accessed = true;
if (!deletingAddressSpace) { if (!deletingAddressSpace)
if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE) InvalidatePage(address);
fInvalidPages[fInvalidPagesCount] = address;
fInvalidPagesCount++;
}
} }
if ((oldEntry & X86_PTE_DIRTY) != 0) if ((oldEntry & X86_PTE_DIRTY) != 0)
@@ -720,10 +706,7 @@ restart:
// Note, that we only need to invalidate the address, if the // Note, that we only need to invalidate the address, if the
// accessed flag was set, since only then the entry could have been // accessed flag was set, since only then the entry could have been
// in any TLB. // in any TLB.
if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE) InvalidatePage(start);
fInvalidPages[fInvalidPagesCount] = start;
fInvalidPagesCount++;
} }
} }
@@ -760,12 +743,8 @@ X86VMTranslationMap32Bit::ClearFlags(addr_t va, uint32 flags)
pinner.Unlock(); pinner.Unlock();
if ((oldEntry & flagsToClear) != 0) { if ((oldEntry & flagsToClear) != 0)
if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE) InvalidatePage(va);
fInvalidPages[fInvalidPagesCount] = va;
fInvalidPagesCount++;
}
return B_OK; return B_OK;
} }
@@ -834,10 +813,7 @@ X86VMTranslationMap32Bit::ClearAccessedAndModified(VMArea* area, addr_t address,
// Note, that we only need to invalidate the address, if the // Note, that we only need to invalidate the address, if the
// accessed flags was set, since only then the entry could have been // accessed flags was set, since only then the entry could have been
// in any TLB. // in any TLB.
if (fInvalidPagesCount < PAGE_INVALIDATE_CACHE_SIZE) InvalidatePage(address);
fInvalidPages[fInvalidPagesCount] = address;
fInvalidPagesCount++;
Flush(); Flush();