summaryrefslogtreecommitdiff
path: root/src/sim/system.cc
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2011-07-10 12:56:08 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2011-07-10 12:56:08 -0500
commit60579e8d74cecea5737a4502599ccf77e9e6a35e (patch)
tree34e86b09774b7a10ba1948b189d00006d19ed684 /src/sim/system.cc
parent9751a1d3e78cbbcd17835ab967f036945ee2cec2 (diff)
downloadgem5-60579e8d74cecea5737a4502599ccf77e9e6a35e.tar.xz
O3: Make sure fetch doesn't go off into the weeds during speculation.
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r--src/sim/system.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index bb8eccf14..81a8a0574 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -83,6 +83,16 @@ System::System(Params *p)
// add self to global system list
systemList.push_back(this);
+ /** Keep track of all memories we can execute code out of
+ * in our system
+ */
+ for (int x = 0; x < p->memories.size(); x++) {
+ if (!p->memories[x])
+ continue;
+ memRanges.push_back(RangeSize(p->memories[x]->start(),
+ p->memories[x]->size()));
+ }
+
#if FULL_SYSTEM
kernelSymtab = new SymbolTable;
if (!debugSymbolTable)
@@ -288,6 +298,17 @@ System::freeMemSize()
#endif
+bool
+System::isMemory(const Addr addr) const
+{
+ std::list<Range<Addr> >::const_iterator i;
+ for (i = memRanges.begin(); i != memRanges.end(); i++) {
+ if (*i == addr)
+ return true;
+ }
+ return false;
+}
+
void
System::resume()
{