diff options
Diffstat (limited to 'cpu/exec_context.cc')
-rw-r--r-- | cpu/exec_context.cc | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/cpu/exec_context.cc b/cpu/exec_context.cc index 7332b86a6..23ae7eda8 100644 --- a/cpu/exec_context.cc +++ b/cpu/exec_context.cc @@ -121,24 +121,55 @@ ExecContext::unserialize(Checkpoint *cp, const std::string §ion) void -ExecContext::setStatus(Status new_status) +ExecContext::activate(int delay) { -#ifdef FULL_SYSTEM - if (status() == new_status) + if (status() == Active) return; + _status = Active; + cpu->activateContext(thread_num, delay); +} + +void +ExecContext::suspend() +{ + if (status() == Suspended) + return; + +#ifdef FULL_SYSTEM // Don't change the status from active if there are pending interrupts - if (new_status == Suspended && cpu->check_interrupts()) { + if (cpu->check_interrupts()) { assert(status() == Active); return; } #endif - _status = new_status; - cpu->execCtxStatusChg(thread_num); + _status = Suspended; + cpu->suspendContext(thread_num); } void +ExecContext::deallocate() +{ + if (status() == Unallocated) + return; + + _status = Unallocated; + cpu->deallocateContext(thread_num); +} + +void +ExecContext::halt() +{ + if (status() == Halted) + return; + + _status = Halted; + cpu->haltContext(thread_num); +} + + +void ExecContext::regStats(const string &name) { #ifdef FULL_SYSTEM |