From 273e3d49244b3c4f9f62c67431f60f4a0ab5906c Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Sun, 6 Feb 2011 22:14:19 -0800 Subject: mem: Added support for Null data packet The packet now identifies whether static or dynamic data has been allocated and is used by Ruby to determine whehter to copy the data pointer into the ruby request. Subsequently, Ruby can be told not to update phys memory when receiving packets. --- src/mem/packet.hh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mem/packet.hh') diff --git a/src/mem/packet.hh b/src/mem/packet.hh index 19fff7e3a..bcf9d8d68 100644 --- a/src/mem/packet.hh +++ b/src/mem/packet.hh @@ -681,9 +681,9 @@ class Packet : public FastAlloc, public Printable */ template T* - getPtr() + getPtr(bool null_ok = false) { - assert(flags.isSet(STATIC_DATA|DYNAMIC_DATA)); + assert(null_ok || flags.isSet(STATIC_DATA|DYNAMIC_DATA)); return (T*)data; } @@ -768,7 +768,6 @@ class Packet : public FastAlloc, public Printable data = new uint8_t[getSize()]; } - /** * Check a functional request against a memory value represented * by a base/size pair and an associated data array. If the -- cgit v1.2.3