ARM: Implement WFE/WFI/SEV semantics.
[gem5.git] / src / sim / system.cc
index d590adc91ff26d80033bfb476e9fcf504693a6be..bb8eccf148e908519d16d9a10c25c74661b0f28b 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2003-2006 The Regents of The University of Michigan
+ * Copyright (c) 2011 Regents of the University of California
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,6 +30,7 @@
  *          Lisa Hsu
  *          Nathan Binkert
  *          Ali Saidi
+ *          Rick Strong
  */
 
 #include "arch/isa_traits.hh"
 #include "base/loader/object_file.hh"
 #include "base/loader/symtab.hh"
 #include "base/trace.hh"
-#include "cpu/thread_context.hh"
 #include "config/full_system.hh"
 #include "config/the_isa.hh"
+#include "cpu/thread_context.hh"
+#include "debug/Loader.hh"
 #include "mem/mem_object.hh"
 #include "mem/physical.hh"
 #include "sim/byteswap.hh"
-#include "sim/system.hh"
 #include "sim/debug.hh"
+#include "sim/system.hh"
 
 #if FULL_SYSTEM
 #include "arch/vtophys.hh"
@@ -70,7 +73,12 @@ System::System(Params *p)
       pagePtr(0),
       nextPID(0),
 #endif
-      memoryMode(p->mem_mode), _params(p)
+      memoryMode(p->mem_mode),
+      workItemsBegin(0),
+      workItemsEnd(0),
+      _params(p),
+      totalNumInsts(0), 
+      instEventQueue("system instruction-based event queue")
 {
     // add self to global system list
     systemList.push_back(this);
@@ -140,6 +148,8 @@ System::System(Params *p)
 
     // increment the number of running systms
     numSystemsRunning++;
+
+    activeCpus.clear();
 }
 
 System::~System()
@@ -214,6 +224,8 @@ System::registerThreadContext(ThreadContext *tc, int assigned)
         remoteGDB[id] = rgdb;
     }
 
+    activeCpus.push_back(false);
+
     return id;
 }
 
@@ -276,6 +288,13 @@ System::freeMemSize()
 
 #endif
 
+void
+System::resume()
+{
+    SimObject::resume();
+    totalNumInsts = 0;
+}
+
 void
 System::serialize(ostream &os)
 {