diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2012-07-10 22:51:54 -0700 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2012-07-10 22:51:54 -0700 |
commit | 52540b1b785aac9b307dfcc976527d94899deb94 (patch) | |
tree | 1a35560c0a4258bd7461bd8a25fdccc7c95d46b6 | |
parent | 2e47aaabc0f5b3ab3d4507b023f0421fde9713c5 (diff) | |
download | gem5-52540b1b785aac9b307dfcc976527d94899deb94.tar.xz |
x86: logSize and lruSeq are now optional ckpt params
-rw-r--r-- | src/arch/x86/pagetable.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/arch/x86/pagetable.cc b/src/arch/x86/pagetable.cc index bfd2efe61..40d5e0984 100644 --- a/src/arch/x86/pagetable.cc +++ b/src/arch/x86/pagetable.cc @@ -37,6 +37,7 @@ * Authors: Gabe Black */ +#include <cmath> #include "arch/x86/isa_traits.hh" #include "arch/x86/pagetable.hh" #include "sim/serialize.hh" @@ -69,14 +70,25 @@ TlbEntry::unserialize(Checkpoint *cp, const std::string §ion) { UNSERIALIZE_SCALAR(paddr); UNSERIALIZE_SCALAR(vaddr); - UNSERIALIZE_SCALAR(logBytes); + // + // The logBytes scalar variable replaced the previous size variable. + // The following code maintains backwards compatibility with previous + // checkpoints using the old size variable. + // + if (UNSERIALIZE_OPT_SCALAR(logBytes) == false) { + int size; + UNSERIALIZE_SCALAR(size); + logBytes = log2(size); + } UNSERIALIZE_SCALAR(writable); UNSERIALIZE_SCALAR(user); UNSERIALIZE_SCALAR(uncacheable); UNSERIALIZE_SCALAR(global); UNSERIALIZE_SCALAR(patBit); UNSERIALIZE_SCALAR(noExec); - UNSERIALIZE_SCALAR(lruSeq); + if (UNSERIALIZE_OPT_SCALAR(lruSeq) == false) { + lruSeq = 0; + } } } |