45 #include "arch/isa_traits.hh"
47 #include "config/the_isa.hh"
51 #ifndef __MEM_PACKET_ACCESS_HH__
52 #define __MEM_PACKET_ACCESS_HH__
59 assert(
sizeof(T) <=
size);
68 assert(
sizeof(T) <=
size);
77 return betoh(getRaw<T>());
84 return letoh(getRaw<T>());
99 panic(
"Illegal byte order in Packet::get()\n");
103 template <
typename T>
110 template <
typename T>
117 template <
typename T>
124 template <
typename T>
136 panic(
"Illegal byte order in Packet::set()\n");
140 template <
typename T>
147 #endif //__MEM_PACKET_ACCESS_HH__
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
The data pointer points to a value that should be freed when the packet is destroyed.
Is the data pointer set to a value that shouldn't be freed when the packet is destroyed?
void setRaw(T v)
Set the value in the data pointer to v without byte swapping.
void setBE(T v)
Set the value in the data pointer to v as big endian.
void setLE(T v)
Set the value in the data pointer to v as little endian.
T get() const
Get the data in the packet byte swapped from guest to host endian.
PacketDataPtr data
A pointer to the data being transfered.
unsigned size
The size of the request or transfer.
T getRaw() const
Get the data in the packet without byte swapping.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Declaration of the Packet class.
T getBE() const
Get the data in the packet byte swapped from big endian to host endian.