From 7617dcf736b5b96d44aedccd51550be037e7b937 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 15 Apr 2009 13:18:24 -0700 Subject: ThreadState: initialize status to Halted in constructor. This provides a common initial status for all threads independent of CPU model (unlike the prior situation where CPUs initialized threads to inconsistent states). This mostly matters for SE mode; in FS mode, ISA-specific startupCPU() methods generally handle boot-time initialization of thread contexts (since the right thing to do is ISA-dependent). --- src/cpu/thread_state.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/cpu/thread_state.cc') diff --git a/src/cpu/thread_state.cc b/src/cpu/thread_state.cc index b0e719ddf..09af2725a 100644 --- a/src/cpu/thread_state.cc +++ b/src/cpu/thread_state.cc @@ -44,20 +44,20 @@ #if FULL_SYSTEM ThreadState::ThreadState(BaseCPU *cpu, int _tid) - : baseCpu(cpu), _threadId(_tid), lastActivate(0), lastSuspend(0), +#else +ThreadState::ThreadState(BaseCPU *cpu, int _tid, + Process *_process, short _asid) +#endif + : numInst(0), numLoad(0), _status(ThreadContext::Halted), + baseCpu(cpu), _threadId(_tid), lastActivate(0), lastSuspend(0), +#if FULL_SYSTEM profile(NULL), profileNode(NULL), profilePC(0), quiesceEvent(NULL), kernelStats(NULL), physPort(NULL), virtPort(NULL), - microPC(0), nextMicroPC(1), funcExeInst(0), storeCondFailures(0) #else -ThreadState::ThreadState(BaseCPU *cpu, int _tid, Process *_process, - short _asid) - : baseCpu(cpu), _threadId(_tid), lastActivate(0), lastSuspend(0), port(NULL), process(_process), asid(_asid), - microPC(0), nextMicroPC(1), funcExeInst(0), storeCondFailures(0) #endif + microPC(0), nextMicroPC(1), funcExeInst(0), storeCondFailures(0) { - numInst = 0; - numLoad = 0; } ThreadState::~ThreadState() -- cgit v1.2.3