summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2011-06-16 15:08:12 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2011-06-16 15:08:12 -0500
commit8b4307f8d863b1805ec0e282bccda23ff4863f16 (patch)
treecb36ccd4b559b4bda0a42193a9f27f96c2da781c /src/arch
parent9fe3610b32545b33767fc22b9fdd7f19046077d0 (diff)
downloadgem5-8b4307f8d863b1805ec0e282bccda23ff4863f16.tar.xz
ARM: Handle case where new TLB size is different from previous TLB size.
After a checkpoint we need to make sure that we restore the right number of entries.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/tlb.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/arch/arm/tlb.cc b/src/arch/arm/tlb.cc
index a2b1a9d8a..c59498212 100644
--- a/src/arch/arm/tlb.cc
+++ b/src/arch/arm/tlb.cc
@@ -264,6 +264,9 @@ TLB::serialize(ostream &os)
DPRINTF(Checkpoint, "Serializing Arm TLB\n");
SERIALIZE_SCALAR(_attr);
+
+ int num_entries = size;
+ SERIALIZE_SCALAR(num_entries);
for(int i = 0; i < size; i++){
nameOut(os, csprintf("%s.TlbEntry%d", name(), i));
table[i].serialize(os);
@@ -276,7 +279,9 @@ TLB::unserialize(Checkpoint *cp, const string &section)
DPRINTF(Checkpoint, "Unserializing Arm TLB\n");
UNSERIALIZE_SCALAR(_attr);
- for(int i = 0; i < size; i++){
+ int num_entries;
+ UNSERIALIZE_SCALAR(num_entries);
+ for(int i = 0; i < min(size, num_entries); i++){
table[i].unserialize(cp, csprintf("%s.TlbEntry%d", section, i));
}
miscRegValid = false;