diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2007-02-12 13:22:36 -0500 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2007-02-12 13:22:36 -0500 |
commit | b9005f35621c564fb70b60223352732eb9cde955 (patch) | |
tree | 0e1dc7cbbefbcf829a0c0cae92095c6255299915 /src/mem/packet_access.hh | |
parent | ad17b3265178deacb2dce7a98033575c0e98f518 (diff) | |
parent | b5a4d95811db487d946200bf103e2af376db7690 (diff) | |
download | gem5-b9005f35621c564fb70b60223352732eb9cde955.tar.xz |
Merge zizzer:/bk/newmem
into zeep.pool:/z/saidi/work/m5.newmem
src/cpu/simple/atomic.cc:
merge steve's changes in.
--HG--
extra : convert_revision : a17eda37cd63c9380af6fe68b0aef4b1e1974231
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 |