summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-11-09 15:06:00 -0500
committerKevin Lim <ktlim@umich.edu>2006-11-09 15:06:00 -0500
commit6591ebb09839586b6849cd28b7c888a2757ba676 (patch)
tree0af7cab23e52bac2529049ec2abf8829479cdd9a /src/cpu
parentf4aa4e43c41fa688abbee9dfa5b2a35a44b2dcf5 (diff)
parent0ba2cc6571f80beb3600000649403cbff0b67d8b (diff)
downloadgem5-6591ebb09839586b6849cd28b7c888a2757ba676.tar.xz
Merge ktlim@zizzer:/bk/newmem
into zamp.eecs.umich.edu:/z/ktlim2/clean/newmem-busfix --HG-- extra : convert_revision : dafe2d4a032b277c219ea13faf20567c20c1f2f4
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/o3/cpu.cc6
-rw-r--r--src/cpu/simple/atomic.cc3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index dfe42d882..580816372 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -819,6 +819,12 @@ unsigned int
FullO3CPU<Impl>::drain(Event *drain_event)
{
DPRINTF(O3CPU, "Switching out\n");
+
+ // If the CPU isn't doing anything, then return immediately.
+ if (_status == Idle || _status == SwitchedOut) {
+ return 0;
+ }
+
drainCount = 0;
fetch.drain();
decode.drain();
diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc
index 4f68cfd6f..f94ea0917 100644
--- a/src/cpu/simple/atomic.cc
+++ b/src/cpu/simple/atomic.cc
@@ -213,6 +213,9 @@ AtomicSimpleCPU::takeOverFrom(BaseCPU *oldCPU)
break;
}
}
+ if (_status != Running) {
+ _status = Idle;
+ }
}