summaryrefslogtreecommitdiff
path: root/src/arch/x86/tlb.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-11-12 14:39:07 -0800
committerGabe Black <gblack@eecs.umich.edu>2007-11-12 14:39:07 -0800
commit49507982685b4e807e612ff176fb67901415a2ce (patch)
tree5f056c6d333f78cc8f0e071eddb238d15216e756 /src/arch/x86/tlb.cc
parentf1f5dd79bf8c2cf2ef64cc1432a4a0601d475e72 (diff)
downloadgem5-49507982685b4e807e612ff176fb67901415a2ce.tar.xz
X86: Implement tlb invalidation and make it happen some of the times it should.
--HG-- extra : convert_revision : 376516d33cd539fa526c834ef2b2c33069af3040
Diffstat (limited to 'src/arch/x86/tlb.cc')
-rw-r--r--src/arch/x86/tlb.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc
index 704ab3027..1184bf9de 100644
--- a/src/arch/x86/tlb.cc
+++ b/src/arch/x86/tlb.cc
@@ -380,6 +380,7 @@ TLB::Walker::start(ThreadContext * _tc, Addr vaddr)
}
}
}
+
nextState = Ready;
entry.vaddr = vaddr;
@@ -595,11 +596,27 @@ TLB::lookup(Addr va, bool update_lru)
void
TLB::invalidateAll()
{
+ DPRINTF(TLB, "Invalidating all entries.\n");
+ while (!entryList.empty()) {
+ TlbEntry *entry = entryList.front();
+ entryList.pop_front();
+ freeList.push_back(entry);
+ }
}
void
TLB::invalidateNonGlobal()
{
+ DPRINTF(TLB, "Invalidating all non global entries.\n");
+ EntryList::iterator entryIt;
+ for (entryIt = entryList.begin(); entryIt != entryList.end();) {
+ if (!(*entryIt)->global) {
+ freeList.push_back(*entryIt);
+ entryList.erase(entryIt++);
+ } else {
+ entryIt++;
+ }
+ }
}
void