diff --git a/src/cpu/base.hh b/src/cpu/base.hh index ac3d1d8926..a124b4282b 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -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) {} diff --git a/src/cpu/inorder/inorder_dyn_inst.cc b/src/cpu/inorder/inorder_dyn_inst.cc index 08f5833389..adde35fdfd 100644 --- a/src/cpu/inorder/inorder_dyn_inst.cc +++ b/src/cpu/inorder/inorder_dyn_inst.cc @@ -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) diff --git a/src/cpu/inorder/inorder_dyn_inst.hh b/src/cpu/inorder/inorder_dyn_inst.hh index 7558df7d1d..053a72d1d0 100644 --- a/src/cpu/inorder/inorder_dyn_inst.hh +++ b/src/cpu/inorder/inorder_dyn_inst.hh @@ -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 diff --git a/src/cpu/inorder/thread_context.hh b/src/cpu/inorder/thread_context.hh index e29b8f2735..7b1dc833f1 100644 --- a/src/cpu/inorder/thread_context.hh +++ b/src/cpu/inorder/thread_context.hh @@ -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() diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 2ae1855325..7ed3944cf7 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 0fd08a68bc..c263790cea 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. */ diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index 5130e2960b..6101ff30f6 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -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) { diff --git a/src/cpu/simple/base.hh b/src/cpu/simple/base.hh index 43d96fbeb7..8f38a33c88 100644 --- a/src/cpu/simple/base.hh +++ b/src/cpu/simple/base.hh @@ -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