summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/System.py2
-rw-r--r--src/sim/system.cc3
-rw-r--r--src/sim/system.hh8
3 files changed, 12 insertions, 1 deletions
diff --git a/src/sim/System.py b/src/sim/System.py
index 06a54a78d..5cf46ad75 100644
--- a/src/sim/System.py
+++ b/src/sim/System.py
@@ -50,3 +50,5 @@ class System(SimObject):
kernel = Param.String("", "file that contains the kernel code")
readfile = Param.String("", "file to read startup script from")
symbolfile = Param.String("", "file to get the symbols from")
+ load_addr_mask = Param.UInt64(0xffffffffff,
+ "Address to mask loading binaries with");
diff --git a/src/sim/system.cc b/src/sim/system.cc
index c7f5b2d08..45e06616d 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -66,6 +66,7 @@ System::System(Params *p)
init_param(p->init_param),
functionalPort(p->name + "-fport"),
virtPort(p->name + "-vport"),
+ loadAddrMask(p->load_addr_mask),
#else
page_ptr(0),
next_PID(0),
@@ -109,7 +110,7 @@ System::System(Params *p)
fatal("Could not load kernel file %s", params()->kernel);
// Load program sections into memory
- kernel->loadSections(&functionalPort, LoadAddrMask);
+ kernel->loadSections(&functionalPort, loadAddrMask);
// setup entry points
kernelStart = kernel->textBase();
diff --git a/src/sim/system.hh b/src/sim/system.hh
index eabbc8351..cc92bba09 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -126,6 +126,14 @@ class System : public SimObject
/** Entry point in the kernel to start at */
Addr kernelEntry;
+ /** Mask that should be anded for binary/symbol loading.
+ * This allows one two different OS requirements for the same ISA to be
+ * handled. Some OSes are compiled for a virtual address and need to be
+ * loaded into physical memory that starts at address 0, while other
+ * bare metal tools generate images that start at address 0.
+ */
+ Addr loadAddrMask;
+
#else
int page_ptr;