summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/probe/mem.hh20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/sim/probe/mem.hh b/src/sim/probe/mem.hh
index 506287140..2d4b9aeec 100644
--- a/src/sim/probe/mem.hh
+++ b/src/sim/probe/mem.hh
@@ -47,6 +47,24 @@
namespace ProbePoints {
/**
+ * A struct to hold on to the essential fields from a packet, so that
+ * the packet and underlying request can be safely passed on, and
+ * consequently modified or even deleted.
+ */
+struct PacketInfo {
+ MemCmd cmd;
+ Addr addr;
+ uint32_t size;
+ Request::FlagsType flags;
+
+ explicit PacketInfo(const PacketPtr& pkt) :
+ cmd(pkt->cmd),
+ addr(pkt->getAddr()),
+ size(pkt->getSize()),
+ flags(pkt->req->getFlags()) { }
+};
+
+/**
* Packet probe point
*
* This probe point provides a unified interface for components that
@@ -79,7 +97,7 @@ namespace ProbePoints {
* </ul>
*
*/
-typedef ProbePointArg< ::PacketPtr> Packet;
+typedef ProbePointArg<PacketInfo> Packet;
typedef std::unique_ptr<Packet> PacketUPtr;
}