diff options
Diffstat (limited to 'cpu/simple_cpu')
-rw-r--r-- | cpu/simple_cpu/simple_cpu.cc | 31 | ||||
-rw-r--r-- | cpu/simple_cpu/simple_cpu.hh | 11 |
2 files changed, 13 insertions, 29 deletions
diff --git a/cpu/simple_cpu/simple_cpu.cc b/cpu/simple_cpu/simple_cpu.cc index 41e3de24e..891e6cdb3 100644 --- a/cpu/simple_cpu/simple_cpu.cc +++ b/cpu/simple_cpu/simple_cpu.cc @@ -164,25 +164,6 @@ SimpleCPU::~SimpleCPU() void -SimpleCPU::registerExecContexts() -{ - BaseCPU::registerExecContexts(); - - // if any of this CPU's ExecContexts are active, mark the CPU as - // running and schedule its tick event. - for (int i = 0; i < execContexts.size(); ++i) { - ExecContext *xc = execContexts[i]; - if (xc->status() == ExecContext::Active && _status != Running) { - _status = Running; - // this should only happen at initialization time - assert(curTick == 0); - tickEvent.schedule(0); - } - } -} - - -void SimpleCPU::switchOut() { _status = SwitchedOut; @@ -213,6 +194,18 @@ SimpleCPU::takeOverFrom(BaseCPU *oldCPU) void +SimpleCPU::execCtxStatusChg(int thread_num) { + assert(thread_num == 0); + assert(xc); + + if (xc->status() == ExecContext::Active) + setStatus(Running); + else + setStatus(Idle); +} + + +void SimpleCPU::regStats() { BaseCPU::regStats(); diff --git a/cpu/simple_cpu/simple_cpu.hh b/cpu/simple_cpu/simple_cpu.hh index e1b351cab..60c038163 100644 --- a/cpu/simple_cpu/simple_cpu.hh +++ b/cpu/simple_cpu/simple_cpu.hh @@ -136,8 +136,6 @@ class SimpleCPU : public BaseCPU // execution context ExecContext *xc; - void registerExecContexts(); - void switchOut(); void takeOverFrom(BaseCPU *oldCPU); @@ -178,14 +176,7 @@ class SimpleCPU : public BaseCPU Status status() const { return _status; } - virtual void execCtxStatusChg() { - if (xc) { - if (xc->status() == ExecContext::Active) - setStatus(Running); - else - setStatus(Idle); - } - } + virtual void execCtxStatusChg(int thread_num); void setStatus(Status new_status) { Status old_status = status(); |