Go to the documentation of this file.
41 #ifndef __MEM_PACKET_ACCESS_HH__
42 #define __MEM_PACKET_ACCESS_HH__
52 assert(
sizeof(T) <=
size);
61 assert(
sizeof(T) <=
size);
70 return betoh(getRaw<T>());
77 return letoh(getRaw<T>());
88 case ByteOrder::little:
92 panic(
"Illegal byte order in Packet::get()\n");
103 template <
typename T>
110 template <
typename T>
118 case ByteOrder::little:
122 panic(
"Illegal byte order in Packet::set()\n");
126 #endif //__MEM_PACKET_ACCESS_HH__
T getBE() const
Get the data in the packet byte swapped from big endian to host endian.
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
void setRaw(T v)
Set the value in the data pointer to v without byte swapping.
PacketDataPtr data
A pointer to the data being transferred.
void setBE(T v)
Set the value in the data pointer to v as big endian.
T getRaw() const
Get the data in the packet without byte swapping.
T get(ByteOrder endian) const
Get the data in the packet byte swapped from the specified endianness.
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
@ STATIC_DATA
Is the data pointer set to a value that shouldn't be freed when the packet is destroyed?
void setLE(T v)
Set the value in the data pointer to v as little endian.
unsigned size
The size of the request or transfer.
@ DYNAMIC_DATA
The data pointer points to a value that should be freed when the packet is destroyed.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17