syscall emulation: fix fast build issue
[gem5.git] / src / sim / sim_object.cc
index 503ac56502ee6599449f00bf3a3c8ad521c06bab..44d498c3c2c8ee131e447cc254a36047abeb6f32 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2001-2005 The Regents of The University of Michigan
+ * Copyright (c) 2010 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,6 +38,8 @@
 #include "base/misc.hh"
 #include "base/trace.hh"
 #include "base/types.hh"
+#include "debug/Checkpoint.hh"
+#include "sim/probe/probe.hh"
 #include "sim/sim_object.hh"
 #include "sim/stats.hh"
 
@@ -58,14 +61,13 @@ SimObject::SimObjectList SimObject::simObjectList;
 // SimObject constructor: used to maintain static simObjectList
 //
 SimObject::SimObject(const Params *p)
-    : EventManager(p->eventq), _params(p)
+    : EventManager(getEventQueue(p->eventq_index)), _params(p)
 {
 #ifdef DEBUG
     doDebugBreak = false;
 #endif
-
     simObjectList.push_back(this);
-    state = Running;
+    probeManager = new ProbeManager(this);
 }
 
 void
@@ -76,8 +78,12 @@ SimObject::init()
 void
 SimObject::loadState(Checkpoint *cp)
 {
-    if (cp->sectionExists(name()))
+    if (cp->sectionExists(name())) {
+        DPRINTF(Checkpoint, "unserializing\n");
         unserialize(cp, name());
+    } else {
+        DPRINTF(Checkpoint, "no checkpoint section found\n");
+    }
 }
 
 void
@@ -99,51 +105,49 @@ SimObject::regStats()
 }
 
 void
-SimObject::regFormulas()
+SimObject::resetStats()
 {
 }
 
+/**
+ * No probe points by default, so do nothing in base.
+ */
 void
-SimObject::resetStats()
+SimObject::regProbePoints()
 {
 }
 
-//
-// static function: serialize all SimObjects.
-//
+/**
+ * No probe listeners by default, so do nothing in base.
+ */
 void
-SimObject::serializeAll(ostream &os)
+SimObject::regProbeListeners()
 {
-    SimObjectList::reverse_iterator ri = simObjectList.rbegin();
-    SimObjectList::reverse_iterator rend = simObjectList.rend();
+}
 
-    for (; ri != rend; ++ri) {
-        SimObject *obj = *ri;
-        obj->nameOut(os);
-        obj->serialize(os);
-   }
+ProbeManager *
+SimObject::getProbeManager()
+{
+    return probeManager;
 }
 
+//
+// static function: serialize all SimObjects.
+//
 void
-SimObject::unserializeAll(Checkpoint *cp)
+SimObject::serializeAll(std::ostream &os)
 {
     SimObjectList::reverse_iterator ri = simObjectList.rbegin();
     SimObjectList::reverse_iterator rend = simObjectList.rend();
 
     for (; ri != rend; ++ri) {
         SimObject *obj = *ri;
-        DPRINTFR(Config, "Unserializing '%s'\n",
-                 obj->name());
-        if(cp->sectionExists(obj->name()))
-            obj->unserialize(cp, obj->name());
-        else
-            warn("Not unserializing '%s': no section found in checkpoint.\n",
-                 obj->name());
+        obj->nameOut(os);
+        obj->serialize(os);
    }
 }
 
 
-
 #ifdef DEBUG
 //
 // static function: flag which objects should have the debugger break
@@ -169,36 +173,12 @@ debugObjectBreak(const char *objs)
 #endif
 
 unsigned int
-SimObject::drain(Event *drain_event)
+SimObject::drain(DrainManager *drain_manager)
 {
-    state = Drained;
+    setDrainState(Drained);
     return 0;
 }
 
-void
-SimObject::resume()
-{
-    state = Running;
-}
-
-void
-SimObject::setMemoryMode(State new_mode)
-{
-    panic("setMemoryMode() should only be called on systems");
-}
-
-void
-SimObject::switchOut()
-{
-    panic("Unimplemented!");
-}
-
-void
-SimObject::takeOverFrom(BaseCPU *cpu)
-{
-    panic("Unimplemented!");
-}
-
 
 SimObject *
 SimObject::find(const char *name)