summaryrefslogtreecommitdiff
path: root/src/cpu/testers/rubytest/Check.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-12-02 06:07:34 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2014-12-02 06:07:34 -0500
commit25bfc249998b26403d50587eb66e6ee5e6de5b58 (patch)
treec952ab3ac56ae3fe2f5f88fec797e6a1ca252650 /src/cpu/testers/rubytest/Check.cc
parent0e63d2cd62bbab47a5b05b9b5bee8c1dc0da1683 (diff)
downloadgem5-25bfc249998b26403d50587eb66e6ee5e6de5b58.tar.xz
mem: Remove null-check bypassing in Packet::getPtr
This patch removes the parameter that enables bypassing the null check in the Packet::getPtr method. A number of call sites assume the value to be non-null. The one odd case is the RubyTester, which issues zero-sized prefetches(!), and despite being reads they had no valid data pointer. This is now fixed, but the size oddity remains (unless anyone object or has any good suggestions). Finally, in the Ruby Sequencer, appropriate checks are made for flush packets as they have no valid data pointer.
Diffstat (limited to 'src/cpu/testers/rubytest/Check.cc')
-rw-r--r--src/cpu/testers/rubytest/Check.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cpu/testers/rubytest/Check.cc b/src/cpu/testers/rubytest/Check.cc
index 126deba6d..9de766077 100644
--- a/src/cpu/testers/rubytest/Check.cc
+++ b/src/cpu/testers/rubytest/Check.cc
@@ -110,6 +110,11 @@ Check::initiatePrefetch()
req->setThreadContext(index, 0);
PacketPtr pkt = new Packet(req, cmd);
+ // despite the oddity of the 0 size (questionable if this should
+ // even be allowed), a prefetch is still a read and as such needs
+ // a place to store the result
+ uint8_t *data = new uint8_t;
+ pkt->dataDynamic(data);
// push the subblock onto the sender state. The sequencer will
// update the subblock on the return