diff options
Diffstat (limited to 'kern/tru64')
-rw-r--r-- | kern/tru64/tru64_system.cc | 40 | ||||
-rw-r--r-- | kern/tru64/tru64_system.hh | 11 |
2 files changed, 36 insertions, 15 deletions
diff --git a/kern/tru64/tru64_system.cc b/kern/tru64/tru64_system.cc index 823a00e5a..8b4ff668d 100644 --- a/kern/tru64/tru64_system.cc +++ b/kern/tru64/tru64_system.cc @@ -184,24 +184,44 @@ Tru64System::~Tru64System() } -void -Tru64System::init(ExecContext *xc) +int +Tru64System::registerExecContext(ExecContext *xc) { - xc->regs = *initRegs; + int xcIndex = System::registerExecContext(xc); + + if (xcIndex == 0) { + // xc->regs = *initRegs; + xc->initStatus(ExecContext::Active); + } + else { + xc->initStatus(ExecContext::Unallocated); + } + + RemoteGDB *rgdb = new RemoteGDB(this, xc); + GDBListener *gdbl = new GDBListener(rgdb, 7000 + xcIndex); + gdbl->listen(); + + if (remoteGDB.size() <= xcIndex) { + remoteGDB.resize(xcIndex+1); + } + + remoteGDB[xcIndex] = rgdb; + + return xcIndex; +} - remoteGDB = new RemoteGDB(this, xc); - gdbListen = new GDBListener(remoteGDB, 7000); - gdbListen->listen(); - // Reset the system - // - TheISA::init(physmem, &xc->regs); +void +Tru64System::replaceExecContext(ExecContext *xc, int xcIndex) +{ + System::replaceExecContext(xcIndex, xc); + remoteGDB[xcIndex]->replaceExecContext(xc); } bool Tru64System::breakpoint() { - return remoteGDB->trap(ALPHA_KENTRY_IF); + return remoteGDB[0]->trap(ALPHA_KENTRY_IF); } BEGIN_DECLARE_SIM_OBJECT_PARAMS(Tru64System) diff --git a/kern/tru64/tru64_system.hh b/kern/tru64/tru64_system.hh index f1b8bb532..a67792aaf 100644 --- a/kern/tru64/tru64_system.hh +++ b/kern/tru64/tru64_system.hh @@ -29,6 +29,8 @@ #ifndef __TRU64_SYSTEM_HH__ #define __TRU64_SYSTEM_HH__ +#include <vector> + #include "sim/system.hh" #include "targetarch/isa_traits.hh" @@ -48,8 +50,6 @@ class AlphaArguments; class Tru64System : public System { private: - ExecContext *xc; - EcoffObject *kernel; EcoffObject *console; @@ -74,8 +74,8 @@ class Tru64System : public System Addr kernelEntry; public: - RemoteGDB *remoteGDB; - GDBListener *gdbListen; + std::vector<RemoteGDB *> remoteGDB; + std::vector<GDBListener *> gdbListen; public: Tru64System(const std::string _name, @@ -88,7 +88,8 @@ class Tru64System : public System const std::string &boot_osflags); ~Tru64System(); - void init(ExecContext *xc); + int registerExecContext(ExecContext *xc); + void replaceExecContext(ExecContext *xc, int xcIndex); Addr getKernelStart() const { return kernelStart; } Addr getKernelEnd() const { return kernelEnd; } |