summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMitch Hayenga <mitch.hayenga@arm.com>2014-09-20 17:18:36 -0400
committerMitch Hayenga <mitch.hayenga@arm.com>2014-09-20 17:18:36 -0400
commitcc6523e2d686447f90acccac20c0fb2940dc3e3b (patch)
tree1db59dcca74fcc7f5fbebf76c06831a438c2990a /src
parente1403fc2af61c224c573c47c77a36f9b1b78e7df (diff)
downloadgem5-cc6523e2d686447f90acccac20c0fb2940dc3e3b.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/cpu/base.hh3
-rw-r--r--src/cpu/inorder/inorder_dyn_inst.cc6
-rw-r--r--src/cpu/inorder/inorder_dyn_inst.hh7
-rw-r--r--src/cpu/inorder/thread_context.hh3
-rw-r--r--src/cpu/o3/cpu.cc16
-rw-r--r--src/cpu/o3/cpu.hh5
-rw-r--r--src/cpu/simple/base.cc8
-rw-r--r--src/cpu/simple/base.hh1
8 files changed, 5 insertions, 44 deletions
diff --git a/src/cpu/base.hh b/src/cpu/base.hh
index ac3d1d892..a124b4282 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 08f583338..adde35fdf 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 7558df7d1..053a72d1d 100644
--- a/src/cpu/inorder/inorder_dyn_inst.hh
+++ b/src/cpu/inorder/inorder_dyn_inst.hh
@@ -533,13 +533,6 @@ class InOrderDynInst : public ExecContext, public RefCounted
////////////////////////////////////////////////////////////
//
- // 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 e29b8f273..7b1dc833f 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 2ae185532..7ed3944cf 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -730,20 +730,12 @@ 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>
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
@@ -326,11 +326,6 @@ class FullO3CPU : public BaseO3CPU
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.
*/
void haltContext(ThreadID tid);
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index 5130e2960..6101ff30f 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -133,14 +133,6 @@ BaseSimpleCPU::~BaseSimpleCPU()
}
void
-BaseSimpleCPU::deallocateContext(ThreadID thread_num)
-{
- // for now, these are equivalent
- suspendContext(thread_num);
-}
-
-
-void
BaseSimpleCPU::haltContext(ThreadID thread_num)
{
// for now, these are equivalent
diff --git a/src/cpu/simple/base.hh b/src/cpu/simple/base.hh
index 43d96fbeb..8f38a33c8 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