41#ifndef __MEM_PACKET_ACCESS_HH__
42#define __MEM_PACKET_ACCESS_HH__
55 assert(
sizeof(T) <=
size);
64 assert(
sizeof(T) <=
size);
91 case ByteOrder::little:
95 panic(
"Illegal byte order in Packet::get()\n");
121 case ByteOrder::little:
125 panic(
"Illegal byte order in Packet::set()\n");
@ DYNAMIC_DATA
The data pointer points to a value that should be freed when the packet is destroyed.
@ 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.
void setBE(T v)
Set the value in the data pointer to v as big endian.
T getBE() const
Get the data in the packet byte swapped from big endian to host endian.
void setRaw(T v)
Set the value in the data pointer to v without byte swapping.
void set(T v, ByteOrder endian)
Set the value in the data pointer to v using the specified endianness.
unsigned size
The size of the request or transfer.
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.
PacketDataPtr data
A pointer to the data being transferred.
bool isSet(Type mask) const
Verifies whether any bit matching the given mask is set.
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Declaration of the Packet class.