summaryrefslogtreecommitdiff
path: root/cpu/exec_context.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2003-12-10 17:47:28 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2003-12-10 17:47:28 -0800
commit4ce6118fdac16cfdc0d945e8793ace3379779288 (patch)
tree73d1b9ca10a321d4b022177396262a9386a36f42 /cpu/exec_context.cc
parentdb6038937d126ec11e7745a1182c69f79b92f41f (diff)
downloadgem5-4ce6118fdac16cfdc0d945e8793ace3379779288.tar.xz
Factor ExecContext::setStatus(), BaseCPU::execCtxStatusChange(),
and SimpleCPU::setStatus() into separate functions. For example, setStatus(Active) is now activate(). --HG-- extra : convert_revision : 4392e07caf6c918db0b535f613175109681686fe
Diffstat (limited to 'cpu/exec_context.cc')
-rw-r--r--cpu/exec_context.cc43
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 &section)
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