summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2011-02-06 22:14:19 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2011-02-06 22:14:19 -0800
commit273e3d49244b3c4f9f62c67431f60f4a0ab5906c (patch)
tree49684bbae069732f12864e5208e63c3153419764 /src/mem/packet.hh
parentdfa8cbeb06b7556753c26b97978924c1f4a24699 (diff)
downloadgem5-273e3d49244b3c4f9f62c67431f60f4a0ab5906c.tar.xz
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.
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh5
1 files changed, 2 insertions, 3 deletions
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 <typename T>
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