diff options
Diffstat (limited to 'src/mem/packet_access.hh')
-rw-r--r-- | src/mem/packet_access.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mem/packet_access.hh b/src/mem/packet_access.hh index aac0c3ae5..882aa98d0 100644 --- a/src/mem/packet_access.hh +++ b/src/mem/packet_access.hh @@ -30,6 +30,7 @@ */ #include "arch/isa_traits.hh" +#include "base/bigint.hh" #include "mem/packet.hh" #include "sim/byteswap.hh" @@ -40,6 +41,19 @@ // 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 |