ARM: Implement WFE/WFI/SEV semantics.
[gem5.git] / src / sim / sim_events.cc
index 8c706382d5f263a7eb207ae31b23fec17044a055..aac844429767ccc18e30e102baf3350cd6ad96a4 100644 (file)
@@ -66,7 +66,7 @@ SimLoopExitEvent::process()
     // but if you are doing this on intervals, don't forget to make another
     if (repeat) {
         assert(getFlags(IsMainQueue));
-        mainEventQueue.schedule(this, curTick + repeat);
+        mainEventQueue.schedule(this, curTick() + repeat);
     }
 }
 
@@ -85,14 +85,14 @@ exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat)
 }
 
 CountedDrainEvent::CountedDrainEvent()
-    : SimLoopExitEvent("Finished drain", 0), count(0)
+    : count(0)
 { }
 
 void
 CountedDrainEvent::process()
 {
     if (--count == 0)
-        exitSimLoop(cause, code);
+        exitSimLoop("Finished drain", 0);
 }
 
 //
@@ -123,36 +123,3 @@ CountedExitEvent::description() const
 {
     return "counted exit";
 }
-
-CheckSwapEvent::CheckSwapEvent(int ival)
-    : interval(ival)
-{
-    mainEventQueue.schedule(this, curTick + interval);
-}
-
-void
-CheckSwapEvent::process()
-{
-    /*  Check the amount of free swap space  */
-    long swap;
-
-    /*  returns free swap in KBytes  */
-    swap = procInfo("/proc/meminfo", "SwapFree:");
-
-    if (swap < 1000)
-        ccprintf(cerr, "\a\a\aWarning! Swap space is low (%d)\n", swap);
-
-    if (swap < 100) {
-        cerr << "\a\aAborting Simulation! Inadequate swap space!\n\n";
-        exitSimLoop("Lack of swap space");
-    }
-
-    assert(getFlags(IsMainQueue));
-    mainEventQueue.schedule(this, curTick + interval);
-}
-
-const char *
-CheckSwapEvent::description() const
-{
-    return "check swap";
-}