Bus: Fix drain code; old method could return 1 in atomic mode and never call de-...
authorAli Saidi <saidi@eecs.umich.edu>
Wed, 5 Sep 2007 21:12:41 +0000 (17:12 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Wed, 5 Sep 2007 21:12:41 +0000 (17:12 -0400)
--HG--
extra : convert_revision : 35990e5eaf93f7a95a0ec72e9f92034a042def3e

src/mem/bus.cc

index cc3504e8339c715fe1fc2e2a6eb12d22471766b8..6e790e438f1f35dbee1f071f91b0c454e147b8b7 100644 (file)
@@ -613,12 +613,11 @@ Bus::drain(Event * de)
     //We should check that we're not "doing" anything, and that noone is
     //waiting. We might be idle but have someone waiting if the device we
     //contacted for a retry didn't actually retry.
-    if (curTick >= tickNextIdle && retryList.size() == 0) {
-        return 0;
-    } else {
+    if (retryList.size() || (curTick < tickNextIdle && busIdle.scheduled())) {
         drainEvent = de;
         return 1;
     }
+    return 0;
 }
 
 void