From cc6523e2d686447f90acccac20c0fb2940dc3e3b Mon Sep 17 00:00:00 2001 From: Mitch Hayenga Date: Sat, 20 Sep 2014 17:18:36 -0400 Subject: 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. --- src/cpu/o3/cpu.cc | 16 +++++----------- src/cpu/o3/cpu.hh | 5 ----- 2 files changed, 5 insertions(+), 16 deletions(-) (limited to 'src/cpu/o3') diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 2ae185532..7ed3944cf 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -728,22 +728,14 @@ FullO3CPU::activateContext(ThreadID tid) } } -template -void -FullO3CPU::deallocateContext(ThreadID tid, bool remove) -{ - deactivateThread(tid); - if (remove) - removeThread(tid); -} - template void FullO3CPU::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::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 diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index 0fd08a68b..c263790ce 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -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. */ -- cgit v1.2.3