arm: Clean up and document decoder API
[gem5.git] / src / arch / x86 / pagetable.cc
index 40d5e09840295450a3a3ad297a22bb48dcda06e6..cd4df42e7934356dba2503cd3066ff58f16be354 100644 (file)
 namespace X86ISA
 {
 
-TlbEntry::TlbEntry(Addr asn, Addr _vaddr, Addr _paddr) :
-    paddr(_paddr), vaddr(_vaddr), logBytes(PageShift), writable(true),
-    user(true), uncacheable(false), global(false), patBit(0), noExec(false)
+TlbEntry::TlbEntry(Addr asn, Addr _vaddr, Addr _paddr,
+                   bool uncacheable, bool read_only) :
+    paddr(_paddr), vaddr(_vaddr), logBytes(PageShift), writable(!read_only),
+    user(true), uncacheable(uncacheable), global(false), patBit(0),
+    noExec(false)
 {}
 
 void
@@ -70,25 +72,14 @@ TlbEntry::unserialize(Checkpoint *cp, const std::string &section)
 {
     UNSERIALIZE_SCALAR(paddr);
     UNSERIALIZE_SCALAR(vaddr);
-    //
-    // 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(logBytes);
     UNSERIALIZE_SCALAR(writable);
     UNSERIALIZE_SCALAR(user);
     UNSERIALIZE_SCALAR(uncacheable);
     UNSERIALIZE_SCALAR(global);
     UNSERIALIZE_SCALAR(patBit);
     UNSERIALIZE_SCALAR(noExec);
-    if (UNSERIALIZE_OPT_SCALAR(lruSeq) == false) {
-        lruSeq = 0;
-    }
+    UNSERIALIZE_SCALAR(lruSeq);
 }
 
 }