cpu: Remove unused deallocateContext calls

The call paths for de-scheduling a thread are halt() and suspend(), from
the thread context. There is no call to deallocateContext() in general,
though some CPUs chose to define it. This patch removes the function
from BaseCPU and the cores which do not require it.
This commit is contained in:
Mitch Hayenga 2014-09-20 17:18:36 -04:00
parent e1403fc2af
commit cc6523e2d6
8 changed files with 5 additions and 44 deletions

View file

@ -257,9 +257,6 @@ class BaseCPU : public MemObject
/// Notify the CPU that the indicated context is now suspended.
virtual void suspendContext(ThreadID thread_num) {}
/// Notify the CPU that the indicated context is now deallocated.
virtual void deallocateContext(ThreadID thread_num) {}
/// Notify the CPU that the indicated context is now halted.
virtual void haltContext(ThreadID thread_num) {}

View file

@ -571,12 +571,6 @@ InOrderDynInst::setRegOtherThread(int reg_idx, MiscReg val, ThreadID tid)
}
}
void
InOrderDynInst::deallocateContext(int thread_num)
{
this->cpu->deallocateContext(thread_num);
}
Fault
InOrderDynInst::readMem(Addr addr, uint8_t *data,
unsigned size, unsigned flags)

View file

@ -531,13 +531,6 @@ class InOrderDynInst : public ExecContext, public RefCounted
/** Emulates a syscall. */
void syscall(int64_t callnum);
////////////////////////////////////////////////////////////
//
// MULTITHREADING INTERFACE TO CPU MODELS
//
////////////////////////////////////////////////////////////
virtual void deallocateContext(int thread_num);
////////////////////////////////////////////////////////////
//
// PROGRAM COUNTERS - PC/NPC/NPC

View file

@ -281,9 +281,6 @@ class InOrderThreadContext : public ThreadContext
void activateContext()
{ cpu->activateContext(thread->threadId()); }
void deallocateContext()
{ cpu->deallocateContext(thread->threadId()); }
/** Returns the number of consecutive store conditional failures. */
// @todo: Figure out where these store cond failures should go.
unsigned readStCondFailures()

View file

@ -728,22 +728,14 @@ FullO3CPU<Impl>::activateContext(ThreadID tid)
}
}
template <class Impl>
void
FullO3CPU<Impl>::deallocateContext(ThreadID tid, bool remove)
{
deactivateThread(tid);
if (remove)
removeThread(tid);
}
template <class Impl>
void
FullO3CPU<Impl>::suspendContext(ThreadID tid)
{
DPRINTF(O3CPU,"[tid: %i]: Suspending Thread Context.\n", tid);
assert(!switchedOut());
deallocateContext(tid, false);
deactivateThread(tid);
// If this was the last thread then unschedule the tick event.
if (activeThreads.size() == 0)
@ -761,7 +753,9 @@ FullO3CPU<Impl>::haltContext(ThreadID tid)
//For now, this is the same as deallocate
DPRINTF(O3CPU,"[tid:%i]: Halt Context called. Deallocating", tid);
assert(!switchedOut());
deallocateContext(tid, true);
deactivateThread(tid);
removeThread(tid);
}
template <class Impl>

View file

@ -325,11 +325,6 @@ class FullO3CPU : public BaseO3CPU
/** Remove Thread from Active Threads List */
void suspendContext(ThreadID tid);
/** Remove Thread from Active Threads List &&
* Possibly Remove Thread Context from CPU.
*/
void deallocateContext(ThreadID tid, bool remove);
/** Remove Thread from Active Threads List &&
* Remove Thread Context from CPU.
*/

View file

@ -132,14 +132,6 @@ BaseSimpleCPU::~BaseSimpleCPU()
{
}
void
BaseSimpleCPU::deallocateContext(ThreadID thread_num)
{
// for now, these are equivalent
suspendContext(thread_num);
}
void
BaseSimpleCPU::haltContext(ThreadID thread_num)
{

View file

@ -170,7 +170,6 @@ class BaseSimpleCPU : public BaseCPU, public ExecContext
void postExecute();
void advancePC(const Fault &fault);
virtual void deallocateContext(ThreadID thread_num);
virtual void haltContext(ThreadID thread_num);
// statistics