summaryrefslogtreecommitdiff
path: root/src/cpu/o3
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-01-24 07:27:21 -0800
committerNathan Binkert <nate@binkert.org>2009-01-24 07:27:21 -0800
commitf0fb3ac060234ed5860c8d5bca3e84dbd8d30c36 (patch)
tree89c7c0673592e9abc1f7b79189ea7357c6ec1154 /src/cpu/o3
parent56d5212ba7a3588feb8ce0ed5d3a31c704106730 (diff)
downloadgem5-f0fb3ac060234ed5860c8d5bca3e84dbd8d30c36.tar.xz
cpu: provide a wakeup mechanism that can be used to pull CPUs out of sleep.
Make interrupts use the new wakeup method, and pull all of the interrupt stuff into the cpu base class so that only the wakeup code needs to be updated. I tried to make wakeup, wakeCPU, and the various other mechanisms for waking and sleeping a little more sane, but I couldn't understand why the statistics were changing the way they were. Maybe we'll try again some day.
Diffstat (limited to 'src/cpu/o3')
-rw-r--r--src/cpu/o3/cpu.cc27
-rw-r--r--src/cpu/o3/cpu.hh7
2 files changed, 19 insertions, 15 deletions
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index f567c1868..4f6d5d41c 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -894,18 +894,6 @@ FullO3CPU<Impl>::activateWhenReady(int tid)
#if FULL_SYSTEM
template <class Impl>
-void
-FullO3CPU<Impl>::postInterrupt(int int_num, int index)
-{
- BaseCPU::postInterrupt(int_num, index);
-
- if (this->thread[0]->status() == ThreadContext::Suspended) {
- DPRINTF(IPI,"Suspended Processor awoke\n");
- this->threadContexts[0]->activate();
- }
-}
-
-template <class Impl>
Fault
FullO3CPU<Impl>::hwrei(unsigned tid)
{
@@ -1689,6 +1677,21 @@ FullO3CPU<Impl>::wakeCPU()
schedule(tickEvent, nextCycle());
}
+#if FULL_SYSTEM
+template <class Impl>
+void
+FullO3CPU<Impl>::wakeup()
+{
+ if (this->thread[0]->status() != ThreadContext::Suspended)
+ return;
+
+ this->wakeCPU();
+
+ DPRINTF(Quiesce, "Suspended Processor woken\n");
+ this->threadContexts[0]->activate();
+}
+#endif
+
template <class Impl>
int
FullO3CPU<Impl>::getFreeTid()
diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh
index d24e8c383..d14001d0d 100644
--- a/src/cpu/o3/cpu.hh
+++ b/src/cpu/o3/cpu.hh
@@ -402,9 +402,6 @@ class FullO3CPU : public BaseO3CPU
void trap(Fault fault, unsigned tid);
#if FULL_SYSTEM
- /** Posts an interrupt. */
- void postInterrupt(int int_num, int index);
-
/** HW return from error interrupt. */
Fault hwrei(unsigned tid);
@@ -701,6 +698,10 @@ class FullO3CPU : public BaseO3CPU
/** Wakes the CPU, rescheduling the CPU if it's not already active. */
void wakeCPU();
+#if FULL_SYSTEM
+ virtual void wakeup();
+#endif
+
/** Gets a free thread id. Use if thread ids change across system. */
int getFreeTid();