ruby: MI protocol: add a missing transition
[gem5.git] / src / mem / packet_access.hh
index 882aa98d0c94e57296fb3c203e660765828fe8f6..fca9606fc84a73273a4a3e54f96c9d8e0dedd98d 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "arch/isa_traits.hh"
 #include "base/bigint.hh"
+#include "config/the_isa.hh"
 #include "mem/packet.hh"
 #include "sim/byteswap.hh"
 
 // these functions and make the users do their own byte swapping since
 // the memory system does not in fact have an endianness.
 
-template<>
-inline Twin64_t
-Packet::get()
-{
-    Twin64_t d;
-    assert(staticData || dynamicData);
-    assert(sizeof(Twin64_t) <= size);
-    d.a = TheISA::gtoh(*(uint64_t*)data);
-    d.b = TheISA::gtoh(*((uint64_t*)data + 1));
-    return d;
-}
-
-
 /** return the value of what is pointed to in the packet. */
 template <typename T>
 inline T
 Packet::get()
 {
-    assert(staticData || dynamicData);
+    assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA));
     assert(sizeof(T) <= size);
     return TheISA::gtoh(*(T*)data);
 }
@@ -69,6 +57,7 @@ template <typename T>
 inline void
 Packet::set(T v)
 {
+    assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA));
     assert(sizeof(T) <= size);
     *(T*)data = TheISA::htog(v);
 }