summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
Diffstat (limited to 'sim')
-rw-r--r--sim/process.cc20
-rw-r--r--sim/system.cc13
-rw-r--r--sim/system.hh5
3 files changed, 21 insertions, 17 deletions
diff --git a/sim/process.cc b/sim/process.cc
index 7b27c4274..b483c70dc 100644
--- a/sim/process.cc
+++ b/sim/process.cc
@@ -153,21 +153,11 @@ Process::startup()
// mark this context as active so it will start ticking.
xc->activate(0);
- // Here we are grabbing the memory port of the CPU hosting the
- // initial execution context for initialization. In the long run
- // this is not what we want, since it means that all
- // initialization accesses (e.g., loading object file sections)
- // will be done a cache block at a time through the CPU's cache.
- // We really want something more like:
- //
- // memport = system->physmem->getPort();
- // myPort.setPeer(memport);
- // memport->setPeer(&myPort);
- // initVirtMem = new TranslatingPort(myPort, pTable);
- //
- // but we need our own dummy port "myPort" that doesn't exist.
- // In the short term it works just fine though.
- initVirtMem = xc->getMemPort();
+ Port *mem_port;
+ mem_port = system->physmem->getPort("functional");
+ initVirtMem = new TranslatingPort(pTable, true);
+ mem_port->setPeer(initVirtMem);
+ initVirtMem->setPeer(mem_port);
}
void
diff --git a/sim/system.cc b/sim/system.cc
index 409e41ead..cfa316b11 100644
--- a/sim/system.cc
+++ b/sim/system.cc
@@ -10,7 +10,6 @@
#if FULL_SYSTEM
#include "base/remote_gdb.hh"
#include "kern/kernel_stats.hh"
-#include "mem/functional/memory_control.hh"
#include "arch/vtophys.hh"
#endif
@@ -37,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
*/
@@ -46,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;