summaryrefslogtreecommitdiff
path: root/src/sim/system.cc
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2010-11-08 13:58:22 -0600
committerAli Saidi <Ali.Saidi@ARM.com>2010-11-08 13:58:22 -0600
commit0ea794bcf453093f83c21a56333d78ba1b8dae33 (patch)
tree969727aba252ca3f2f910a6d380a743409e4594e /src/sim/system.cc
parent72b526227857c5eeb90b52fad18eb2d647a27403 (diff)
downloadgem5-0ea794bcf453093f83c21a56333d78ba1b8dae33.tar.xz
sim: Use forward declarations for ports.
Virtual ports need TLB data which means anything touching a file in the arch directory rebuilds any file that includes system.hh which in everything.
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r--src/sim/system.cc15
1 files changed, 8 insertions, 7 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();