summaryrefslogtreecommitdiff
path: root/src/cpu/simple
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/simple
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/simple')
-rw-r--r--src/cpu/simple/base.cc11
-rw-r--r--src/cpu/simple/base.hh2
2 files changed, 6 insertions, 7 deletions
diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index 3c154afb6..89d9ce383 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -303,14 +303,13 @@ BaseSimpleCPU::dbg_vtophys(Addr addr)
#if FULL_SYSTEM
void
-BaseSimpleCPU::postInterrupt(int int_num, int index)
+BaseSimpleCPU::wakeup()
{
- BaseCPU::postInterrupt(int_num, index);
+ if (thread->status() != ThreadContext::Suspended)
+ return;
- if (thread->status() == ThreadContext::Suspended) {
- DPRINTF(Quiesce,"Suspended Processor awoke\n");
- thread->activate();
- }
+ DPRINTF(Quiesce,"Suspended Processor awoke\n");
+ thread->activate();
}
#endif // FULL_SYSTEM
diff --git a/src/cpu/simple/base.hh b/src/cpu/simple/base.hh
index 6e72b8f6c..34d0f5954 100644
--- a/src/cpu/simple/base.hh
+++ b/src/cpu/simple/base.hh
@@ -98,7 +98,7 @@ class BaseSimpleCPU : public BaseCPU
}
public:
- void postInterrupt(int int_num, int index);
+ void wakeup();
void zero_fill_64(Addr addr) {
static int warned = 0;