summaryrefslogtreecommitdiff
path: root/src/cpu/o3/alpha
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2006-07-07 04:06:26 -0400
committerKorey Sewell <ksewell@umich.edu>2006-07-07 04:06:26 -0400
commitc355df5bfea757604113104c99998fb232539a5d (patch)
tree7b5e2d53bb0ce7343be2afbddd36fc56e3ea7221 /src/cpu/o3/alpha
parente60f998e2993df35460c8835016b3043a13da80a (diff)
downloadgem5-c355df5bfea757604113104c99998fb232539a5d.tar.xz
Fix so that O3CPU doesnt segfault on exit.
Major thing was to not execute commit if there are no active threads in CPU. src/cpu/o3/alpha/thread_context.hh: call deallocate instead of deallocateContext src/cpu/o3/commit_impl.hh: dont run commit stage if there are no instructions src/cpu/o3/cpu.cc: add deallocate event, deactivateThread function, and edit deallocateContext. src/cpu/o3/cpu.hh: add deallocate event and add optional delay to deallocateContext src/cpu/o3/thread_context.hh: optional delay for deallocate src/cpu/o3/thread_context_impl.hh: edit DPRINTFs to say Thread Context instead of Alpha TC src/cpu/thread_context.hh: optional delay src/sim/syscall_emul.hh: name stuff --HG-- extra : convert_revision : f4033e1f66b3043d30ad98dcc70d8b193dea70b6
Diffstat (limited to 'src/cpu/o3/alpha')
-rw-r--r--src/cpu/o3/alpha/thread_context.hh15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/cpu/o3/alpha/thread_context.hh b/src/cpu/o3/alpha/thread_context.hh
index 78b0ee788..ad52b0d2e 100644
--- a/src/cpu/o3/alpha/thread_context.hh
+++ b/src/cpu/o3/alpha/thread_context.hh
@@ -70,18 +70,19 @@ class AlphaTC : public O3ThreadContext<Impl>
{ panic("Not supported on Alpha!"); }
- // This function exits the thread context in the CPU and returns
- // 1 if the CPU has no more active threads (meaning it's OK to exit);
- // Used in syscall-emulation mode when a thread executes the 'exit'
- // syscall.
+ /** This function exits the thread context in the CPU and returns
+ * 1 if the CPU has no more active threads (meaning it's OK to exit);
+ * Used in syscall-emulation mode when a thread executes the 'exit'
+ * syscall.
+ */
virtual int exit()
{
- this->cpu->deallocateContext(this->thread->readTid());
+ this->deallocate();
// If there are still threads executing in the system
if (this->cpu->numActiveThreads())
- return 0;
+ return 0; // don't exit simulation
else
- return 1;
+ return 1; // exit simulation
}
};