#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;
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
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;
}