diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/system.cc | 12 | ||||
-rw-r--r-- | sim/system.hh | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/sim/system.cc b/sim/system.cc index c1eaaf916..cfa316b11 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -36,6 +36,16 @@ System::System(Params *p) kernelSymtab = new SymbolTable; debugSymbolTable = new SymbolTable; + + /** + * Get a functional port to memory + */ + Port *mem_port; + mem_port = physmem->getPort("functional"); + functionalPort.setPeer(mem_port); + mem_port->setPeer(&functionalPort); + + /** * Load the kernel code into memory */ @@ -45,7 +55,7 @@ System::System(Params *p) fatal("Could not load kernel file %s", params()->kernel_path); // Load program sections into memory - kernel->loadSections(physmem, true); + kernel->loadSections(&functionalPort, LoadAddrMask); // setup entry points kernelStart = kernel->textBase(); diff --git a/sim/system.hh b/sim/system.hh index 0f82f81f5..11f8ac70a 100644 --- a/sim/system.hh +++ b/sim/system.hh @@ -36,6 +36,7 @@ #include "base/misc.hh" #include "base/statistics.hh" #include "cpu/pc_event.hh" +#include "mem/port.hh" #include "sim/sim_object.hh" #if FULL_SYSTEM #include "kern/system_events.hh" @@ -76,6 +77,10 @@ class System : public SimObject Platform *platform; uint64_t init_param; + /** Port to physical memory used for writing object files into ram at + * boot.*/ + FunctionalPort functionalPort; + /** kernel symbol table */ SymbolTable *kernelSymtab; |