summaryrefslogtreecommitdiff
path: root/src/mem/physical.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-22 23:09:27 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-22 23:09:27 -0500
commitf85082e0a00ff7ba9caf79a58f41c6c4e351cd9d (patch)
treeb6070e39d2895d4db80413344492f07904359982 /src/mem/physical.cc
parent0a99750ebfe9a9b400ee5f0610ed429851345c4b (diff)
downloadgem5-f85082e0a00ff7ba9caf79a58f41c6c4e351cd9d.tar.xz
Added a parameter to set memory to zero. This is to support Legion, and once we can make our own hypervisor binary, we probably won't need it.
--HG-- extra : convert_revision : 168883e4a5d3760962cd9759a6f41c66f5a6402a
Diffstat (limited to 'src/mem/physical.cc')
-rw-r--r--src/mem/physical.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mem/physical.cc b/src/mem/physical.cc
index 9b8ae1fc4..6610e547d 100644
--- a/src/mem/physical.cc
+++ b/src/mem/physical.cc
@@ -65,6 +65,10 @@ PhysicalMemory::PhysicalMemory(Params *p)
fatal("Could not mmap!\n");
}
+ //If requested, initialize all the memory to 0
+ if(params()->zero)
+ memset(pmemAddr, 0, params()->addrRange.size());
+
pagePtr = 0;
}
@@ -432,6 +436,7 @@ BEGIN_DECLARE_SIM_OBJECT_PARAMS(PhysicalMemory)
Param<string> file;
Param<Range<Addr> > range;
Param<Tick> latency;
+ Param<bool> zero;
END_DECLARE_SIM_OBJECT_PARAMS(PhysicalMemory)
@@ -439,7 +444,8 @@ BEGIN_INIT_SIM_OBJECT_PARAMS(PhysicalMemory)
INIT_PARAM_DFLT(file, "memory mapped file", ""),
INIT_PARAM(range, "Device Address Range"),
- INIT_PARAM(latency, "Memory access latency")
+ INIT_PARAM(latency, "Memory access latency"),
+ INIT_PARAM(zero, "Zero initialize memory")
END_INIT_SIM_OBJECT_PARAMS(PhysicalMemory)
@@ -449,6 +455,7 @@ CREATE_SIM_OBJECT(PhysicalMemory)
p->name = getInstanceName();
p->addrRange = range;
p->latency = latency;
+ p->zero = zero;
return new PhysicalMemory(p);
}