syscall_emul: don't check host fd when allocating target fd
[gem5.git] / src / sim / root.cc
index 1102e6a3ad6a2abf0270e0d7619f1e7beb7954ef..7647ca5b7f88ead788c1ed65ce9a3336e2087e91 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2002-2005 The Regents of The University of Michigan
- * Copyright (c) 2011 Advanced Micro Devices
+ * Copyright (c) 2011 Advanced Micro Devices, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  */
 
 #include "base/misc.hh"
+#include "base/trace.hh"
+#include "config/the_isa.hh"
 #include "debug/TimeSync.hh"
+#include "sim/full_system.hh"
 #include "sim/root.hh"
 
 Root *Root::_root = NULL;
@@ -109,6 +112,8 @@ Root::Root(RootParams *p) : SimObject(p), _enabled(false),
     assert(_root == NULL);
     _root = this;
     lastTime.setTimer();
+
+    simQuantum = p->sim_quantum;
 }
 
 void
@@ -118,11 +123,28 @@ Root::initState()
 }
 
 void
-Root::loadState(Checkpoint *cp)
+Root::loadState(CheckpointIn &cp)
 {
+    SimObject::loadState(cp);
     timeSyncEnable(params()->time_sync_enable);
 }
 
+void
+Root::serialize(CheckpointOut &cp) const
+{
+    SERIALIZE_SCALAR(FullSystem);
+    std::string isa = THE_ISA_STR;
+    SERIALIZE_SCALAR(isa);
+}
+
+void
+Root::unserialize(CheckpointIn &cp)
+{}
+
+
+bool FullSystem;
+unsigned int FullSystemInt;
+
 Root *
 RootParams::create()
 {
@@ -132,5 +154,8 @@ RootParams::create()
 
     created = true;
 
+    FullSystem = full_system;
+    FullSystemInt = full_system ? 1 : 0;
+
     return new Root(this);
 }