From d82e0d11d12cdc75ab3c7a51a36630f5bd0c0e11 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 3 Nov 2004 20:46:33 -0500 Subject: make activation of exec contexts happen in startup the registration stuff all moves into BaseCPU cpu/base_cpu.cc: Move the registration stuff into the BaseCPU since all other CPUs use it. cpu/base_cpu.hh: Move the defer registration stuff into the BaseCPU since all other CPUs use it. cpu/simple_cpu/simple_cpu.cc: cpu/simple_cpu/simple_cpu.hh: registration stuff moved to base class sim/system.cc: the activation of exec contexts should happen at startup, not when they are registered. sim/system.hh: the system now has a startup function --HG-- extra : convert_revision : bb6a7c2da5a1ecf5fe7ede1078200bfe5245f8ef --- sim/system.cc | 16 ++++++++++------ sim/system.hh | 2 ++ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'sim') diff --git a/sim/system.cc b/sim/system.cc index 9fdadf649..1b1a145c6 100644 --- a/sim/system.cc +++ b/sim/system.cc @@ -194,12 +194,6 @@ System::registerExecContext(ExecContext *xc) int xcIndex = execContexts.size(); execContexts.push_back(xc); - if (xcIndex == 0) { - // activate with zero delay so that we start ticking right - // away on cycle 0 - xc->activate(0); - } - RemoteGDB *rgdb = new RemoteGDB(this, xc); GDBListener *gdbl = new GDBListener(rgdb, 7000 + xcIndex); gdbl->listen(); @@ -218,6 +212,16 @@ System::registerExecContext(ExecContext *xc) return xcIndex; } +void +System::startup() +{ + if (!execContexts.empty()) { + // activate with zero delay so that we start ticking right + // away on cycle 0 + execContexts[0]->activate(0); + } +} + void System::replaceExecContext(ExecContext *xc, int xcIndex) { diff --git a/sim/system.hh b/sim/system.hh index 5294f417e..61784b044 100644 --- a/sim/system.hh +++ b/sim/system.hh @@ -122,6 +122,8 @@ class System : public SimObject System(Params *p); ~System(); + void startup(); + public: /** * Returns the addess the kernel starts at. -- cgit v1.2.3