arch-arm: Add initial support for SVE contiguous loads/stores
[gem5.git] / src / arch / sparc / pagetable.cc
index 22130d41c53598935af3b5b054b8e839b490f7d7..0a14f0b80ff8bb9f7225343c72b03f6c38a79f0a 100644 (file)
  */
 
 #include "arch/sparc/pagetable.hh"
+
 #include "sim/serialize.hh"
 
 namespace SparcISA
 {
+
 void
-TlbEntry::serialize(std::ostream &os)
+TlbEntry::serialize(CheckpointOut &cp) const
 {
     SERIALIZE_SCALAR(range.va);
     SERIALIZE_SCALAR(range.size);
     SERIALIZE_SCALAR(range.contextId);
     SERIALIZE_SCALAR(range.partitionId);
     SERIALIZE_SCALAR(range.real);
-    uint64_t entry4u = pte();
+    uint64_t entry4u = 0;
+    if (valid)
+        entry4u = pte();
     SERIALIZE_SCALAR(entry4u);
     SERIALIZE_SCALAR(used);
+    SERIALIZE_SCALAR(valid);
 }
 
 
 void
-TlbEntry::unserialize(Checkpoint *cp, const std::string &section)
+TlbEntry::unserialize(CheckpointIn &cp)
 {
     UNSERIALIZE_SCALAR(range.va);
     UNSERIALIZE_SCALAR(range.size);
@@ -57,13 +62,15 @@ TlbEntry::unserialize(Checkpoint *cp, const std::string &section)
     UNSERIALIZE_SCALAR(range.real);
     uint64_t entry4u;
     UNSERIALIZE_SCALAR(entry4u);
-    pte.populate(entry4u);
+    if (entry4u)
+        pte.populate(entry4u);
     UNSERIALIZE_SCALAR(used);
+    UNSERIALIZE_SCALAR(valid);
 }
 
 
-int PageTableEntry::pageSizes[] = {8*1024, 64*1024, 0, 4*1024*1024, 0,
-            256*1024*1024L};
+int PageTableEntry::pageSizes[] =
+    { 8 * 1024, 64 * 1024, 0, 4 * 1024 * 1024, 0, 256 * 1024 * 1024L} ;
 
 
 }