diff options
author | Nathan Binkert <nate@binkert.org> | 2009-01-24 07:27:21 -0800 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2009-01-24 07:27:21 -0800 |
commit | f0fb3ac060234ed5860c8d5bca3e84dbd8d30c36 (patch) | |
tree | 89c7c0673592e9abc1f7b79189ea7357c6ec1154 /src/cpu/base.hh | |
parent | 56d5212ba7a3588feb8ce0ed5d3a31c704106730 (diff) | |
download | gem5-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/base.hh')
-rw-r--r-- | src/cpu/base.hh | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/cpu/base.hh b/src/cpu/base.hh index 83d73ede0..c8215e047 100644 --- a/src/cpu/base.hh +++ b/src/cpu/base.hh @@ -125,9 +125,26 @@ class BaseCPU : public MemObject return interrupts; } - virtual void postInterrupt(int int_num, int index); - virtual void clearInterrupt(int int_num, int index); - virtual void clearInterrupts(); + virtual void wakeup() = 0; + + void + postInterrupt(int int_num, int index) + { + interrupts->post(int_num, index); + wakeup(); + } + + void + clearInterrupt(int int_num, int index) + { + interrupts->clear(int_num, index); + } + + void + clearInterrupts() + { + interrupts->clearAll(); + } bool checkInterrupts(ThreadContext *tc) const |