arm: Clean up and document decoder API
[gem5.git] / src / arch / x86 / pagetable.cc
index 6de4c956f830a263ea58412cb10217a4f4e074a3..cd4df42e7934356dba2503cd3066ff58f16be354 100644 (file)
@@ -37,6 +37,7 @@
  * Authors: Gabe Black
  */
 
+#include <cmath>
 #include "arch/x86/isa_traits.hh"
 #include "arch/x86/pagetable.hh"
 #include "sim/serialize.hh"
 namespace X86ISA
 {
 
-TlbEntry::TlbEntry(Addr asn, Addr _vaddr, Addr _paddr) :
-    paddr(_paddr), vaddr(_vaddr), size(PageBytes), 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
 TlbEntry::serialize(std::ostream &os)
 {
+    SERIALIZE_SCALAR(paddr);
+    SERIALIZE_SCALAR(vaddr);
+    SERIALIZE_SCALAR(logBytes);
+    SERIALIZE_SCALAR(writable);
+    SERIALIZE_SCALAR(user);
+    SERIALIZE_SCALAR(uncacheable);
+    SERIALIZE_SCALAR(global);
+    SERIALIZE_SCALAR(patBit);
+    SERIALIZE_SCALAR(noExec);
+    SERIALIZE_SCALAR(lruSeq);
 }
 
 void
 TlbEntry::unserialize(Checkpoint *cp, const std::string &section)
 {
+    UNSERIALIZE_SCALAR(paddr);
+    UNSERIALIZE_SCALAR(vaddr);
+    UNSERIALIZE_SCALAR(logBytes);
+    UNSERIALIZE_SCALAR(writable);
+    UNSERIALIZE_SCALAR(user);
+    UNSERIALIZE_SCALAR(uncacheable);
+    UNSERIALIZE_SCALAR(global);
+    UNSERIALIZE_SCALAR(patBit);
+    UNSERIALIZE_SCALAR(noExec);
+    UNSERIALIZE_SCALAR(lruSeq);
 }
 
 }