sim-se: Add prlimit system call
[gem5.git] / src / sim / core.cc
index c961e9eb8ed7255c3f560c2f9220e6db446b0731..00df23ed6709a5b99ab12bfa94523e539b62a64a 100644 (file)
@@ -1,5 +1,7 @@
 /*
  * Copyright (c) 2006 The Regents of The University of Michigan
+ * Copyright (c) 2013 Advanced Micro Devices, Inc.
+ * Copyright (c) 2013 Mark D. Hill and David A. Wood
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  *          Steve Reinhardt
  */
 
+#include "sim/core.hh"
+
 #include <iostream>
 #include <string>
 
 #include "base/callback.hh"
 #include "base/output.hh"
-#include "sim/core.hh"
+#include "sim/eventq.hh"
 
 using namespace std;
 
-Tick curTick = 0;
-
-namespace Clock {
-/// The simulated frequency of curTick. (In ticks per second)
+namespace SimClock {
+/// The simulated frequency of curTick(). (In ticks per second)
 Tick Frequency;
 
 namespace Float {
@@ -55,7 +57,7 @@ double Hz;
 double kHz;
 double MHz;
 double GHZ;
-/* namespace Float */ }
+} // namespace Float
 
 namespace Int {
 Tick s;
@@ -63,14 +65,14 @@ Tick ms;
 Tick us;
 Tick ns;
 Tick ps;
-/* namespace Float */ }
+} // namespace Float
 
-/* namespace Clock */ }
+} // namespace SimClock
 
 void
 setClockFrequency(Tick ticksPerSecond)
 {
-    using namespace Clock;
+    using namespace SimClock;
     Frequency = ticksPerSecond;
     Float::s = static_cast<double>(Frequency);
     Float::ms = Float::s / 1.0e3;
@@ -97,15 +99,6 @@ setOutputDir(const string &dir)
     simout.setDirectory(dir);
 }
 
-ostream *outputStream;
-ostream *configStream;
-
-void
-setOutputFile(const string &file)
-{
-    outputStream = simout.find(file);
-}
-
 /**
  * Queue of C++ callbacks to invoke on simulator exit.
  */
@@ -126,7 +119,7 @@ registerExitCallback(Callback *callback)
 }
 
 /**
- * Do C++ simulator exit processing.  Exported to SWIG to be invoked
+ * Do C++ simulator exit processing.  Exported to Python to be invoked
  * when simulator terminates via Python's atexit mechanism.
  */
 void