summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/physical.cc30
-rw-r--r--src/mem/physical.hh5
2 files changed, 35 insertions, 0 deletions
diff --git a/src/mem/physical.cc b/src/mem/physical.cc
index 889794db6..c24300cad 100644
--- a/src/mem/physical.cc
+++ b/src/mem/physical.cc
@@ -1,4 +1,16 @@
/*
+ * Copyright (c) 2010 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2001-2005 The Regents of The University of Michigan
* All rights reserved.
*
@@ -500,6 +512,18 @@ PhysicalMemory::serialize(ostream &os)
if (gzclose(compressedMem))
fatal("Close failed on physical memory checkpoint file '%s'\n",
filename);
+
+ list<LockedAddr>::iterator i = lockedAddrList.begin();
+
+ vector<Addr> lal_addr;
+ vector<int> lal_cid;
+ while (i != lockedAddrList.end()) {
+ lal_addr.push_back(i->addr);
+ lal_cid.push_back(i->contextId);
+ i++;
+ }
+ arrayParamOut(os, "lal_addr", lal_addr);
+ arrayParamOut(os, "lal_cid", lal_cid);
}
void
@@ -579,6 +603,12 @@ PhysicalMemory::unserialize(Checkpoint *cp, const string &section)
fatal("Close failed on physical memory checkpoint file '%s'\n",
filename);
+ vector<Addr> lal_addr;
+ vector<int> lal_cid;
+ arrayParamIn(cp, section, "lal_addr", lal_addr);
+ arrayParamIn(cp, section, "lal_cid", lal_cid);
+ for(int i = 0; i < lal_addr.size(); i++)
+ lockedAddrList.push_front(LockedAddr(lal_addr[i], lal_cid[i]));
}
PhysicalMemory *
diff --git a/src/mem/physical.hh b/src/mem/physical.hh
index 290e2bbae..a19db4d9d 100644
--- a/src/mem/physical.hh
+++ b/src/mem/physical.hh
@@ -105,6 +105,11 @@ class PhysicalMemory : public MemObject
contextId(req->contextId())
{
}
+ // constructor for unserialization use
+ LockedAddr(Addr _addr, int _cid)
+ : addr(_addr), contextId(_cid)
+ {
+ }
};
std::list<LockedAddr> lockedAddrList;