summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/system.cc15
-rw-r--r--src/sim/system.hh7
2 files changed, 12 insertions, 10 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 45e06616d..6ed6b8e42 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -49,6 +49,7 @@
#if FULL_SYSTEM
#include "arch/vtophys.hh"
#include "kern/kernel_stats.hh"
+#include "mem/vport.hh"
#else
#include "params/System.hh"
#endif
@@ -64,8 +65,6 @@ System::System(Params *p)
: SimObject(p), physmem(p->physmem), _numContexts(0),
#if FULL_SYSTEM
init_param(p->init_param),
- functionalPort(p->name + "-fport"),
- virtPort(p->name + "-vport"),
loadAddrMask(p->load_addr_mask),
#else
page_ptr(0),
@@ -86,13 +85,15 @@ System::System(Params *p)
* Get a functional port to memory
*/
Port *mem_port;
+ functionalPort = new FunctionalPort(name() + "-fport");
mem_port = physmem->getPort("functional");
- functionalPort.setPeer(mem_port);
- mem_port->setPeer(&functionalPort);
+ functionalPort->setPeer(mem_port);
+ mem_port->setPeer(functionalPort);
+ virtPort = new VirtualPort(name() + "-fport");
mem_port = physmem->getPort("functional");
- virtPort.setPeer(mem_port);
- mem_port->setPeer(&virtPort);
+ virtPort->setPeer(mem_port);
+ mem_port->setPeer(virtPort);
/**
@@ -110,7 +111,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 cc92bba09..11a4b007a 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -48,7 +48,6 @@
#if FULL_SYSTEM
#include "kern/system_events.hh"
-#include "mem/vport.hh"
#endif
class BaseCPU;
@@ -58,6 +57,8 @@ class PhysicalMemory;
#if FULL_SYSTEM
class Platform;
+class FunctionalPort;
+class VirtualPort;
#endif
class GDBListener;
class BaseRemoteGDB;
@@ -108,8 +109,8 @@ class System : public SimObject
/** Port to physical memory used for writing object files into ram at
* boot.*/
- FunctionalPort functionalPort;
- VirtualPort virtPort;
+ FunctionalPort *functionalPort;
+ VirtualPort *virtPort;
/** kernel symbol table */
SymbolTable *kernelSymtab;