summaryrefslogtreecommitdiff
path: root/src/mem/page_table.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-10-25 20:13:35 -0400
committerAli Saidi <saidi@eecs.umich.edu>2007-10-25 20:13:35 -0400
commit0711f4f17a4b4ac61b07cbe742f0d193f919ea8f (patch)
tree6fdd5b340696c7506dc85f4eb8cb39421da3ccaa /src/mem/page_table.cc
parentb0e3aab5df9328ddfd13e396456cebdcaf0c8912 (diff)
downloadgem5-0711f4f17a4b4ac61b07cbe742f0d193f919ea8f.tar.xz
SE: Fix page table and system serialization, don't reinit process if this is a checkpoint restore.
--HG-- extra : convert_revision : 03dcf3c088e57b7abab60efe700d947117888306
Diffstat (limited to 'src/mem/page_table.cc')
-rw-r--r--src/mem/page_table.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mem/page_table.cc b/src/mem/page_table.cc
index efafc3f19..8889879c3 100644
--- a/src/mem/page_table.cc
+++ b/src/mem/page_table.cc
@@ -118,9 +118,12 @@ bool
PageTable::translate(Addr vaddr, Addr &paddr)
{
TheISA::TlbEntry entry;
- if (!lookup(vaddr, entry))
+ if (!lookup(vaddr, entry)) {
+ DPRINTF(MMU, "Couldn't Translate: %#x\n", vaddr);
return false;
+ }
paddr = pageOffset(vaddr) + entry.pageStart;
+ DPRINTF(MMU, "Translating: %#x->%#x\n", vaddr, paddr);
return true;
}
@@ -151,7 +154,9 @@ PageTable::serialize(std::ostream &os)
PTableItr iter = pTable.begin();
PTableItr end = pTable.end();
while (iter != end) {
- paramOut(os, csprintf("ptable.entry%dvaddr", count), iter->first);
+ os << "\n[" << csprintf("%s.Entry%d", name(), count) << "]\n";
+
+ paramOut(os, "vaddr", iter->first);
iter->second.serialize(os);
++iter;
@@ -166,14 +171,15 @@ PageTable::unserialize(Checkpoint *cp, const std::string &section)
int i = 0, count;
paramIn(cp, section, "ptable.size", count);
Addr vaddr;
- TheISA::TlbEntry entry;
+ TheISA::TlbEntry *entry;
pTable.clear();
while(i < count) {
- paramIn(cp, section, csprintf("ptable.entry%dvaddr", i), vaddr);
- entry.unserialize(cp, section);
- pTable[vaddr] = entry;
+ paramIn(cp, csprintf("%s.Entry%d", name(), i), "vaddr", vaddr);
+ entry = new TheISA::TlbEntry();
+ entry->unserialize(cp, csprintf("%s.Entry%d", name(), i));
+ pTable[vaddr] = *entry;
++i;
}
}