summaryrefslogtreecommitdiff
path: root/cpu/simple_cpu/simple_cpu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/simple_cpu/simple_cpu.cc')
-rw-r--r--cpu/simple_cpu/simple_cpu.cc31
1 files changed, 12 insertions, 19 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();