ruby: set: corrects csprintf() call introduced by 7d95b650c9b6
[gem5.git] / src / sim / arguments.hh
index 14c9e1f8ab196da541ff25d7cdde6ab6c28d09ba..fad95599968396eb7ba5a80f646a04f7f45b1849 100644 (file)
 #ifndef __SIM_ARGUMENTS_HH__
 #define __SIM_ARGUMENTS_HH__
 
-#include <assert.h>
+#include <cassert>
 
 #include "arch/vtophys.hh"
 #include "base/refcnt.hh"
-#include "mem/vport.hh"
-#include "sim/host.hh"
+#include "base/types.hh"
+#include "mem/fs_translating_port_proxy.hh"
 
 class ThreadContext;
 
@@ -45,7 +45,7 @@ class Arguments
   protected:
     ThreadContext *tc;
     int number;
-    uint64_t getArg(bool fp = false);
+    uint64_t getArg(uint16_t size = (uint16_t)(-1), bool fp = false);
 
   protected:
     class Data : public RefCounted
@@ -130,14 +130,14 @@ class Arguments
     template <class T>
     operator T() {
         assert(sizeof(T) <= sizeof(uint64_t));
-        T data = static_cast<T>(getArg());
-        return data;
+        T d = static_cast<T>(getArg(sizeof(T)));
+        return d;
     }
 
     template <class T>
     operator T *() {
         T *buf = (T *)data->alloc(sizeof(T));
-        CopyData(tc, buf, getArg(), sizeof(T));
+        CopyOut(tc, buf, getArg(sizeof(T)), sizeof(T));
         return buf;
     }