mem_checker_monitor.cc (11284:b3926db25371) mem_checker_monitor.cc (11489:47aca087ebb4)
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 143 unchanged lines hidden (view full) ---

152 //
153 // For reads we are only interested in real reads, and not prefetches, as
154 // it is not guaranteed that the prefetch returns any useful data.
155 bool is_read = pkt->isRead() && !pkt->req->isPrefetch();
156 bool is_write = pkt->isWrite();
157 unsigned size = pkt->getSize();
158 Addr addr = pkt->getAddr();
159 bool expects_response = pkt->needsResponse() && !pkt->cacheResponding();
1/*
2 * Copyright (c) 2012-2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 143 unchanged lines hidden (view full) ---

152 //
153 // For reads we are only interested in real reads, and not prefetches, as
154 // it is not guaranteed that the prefetch returns any useful data.
155 bool is_read = pkt->isRead() && !pkt->req->isPrefetch();
156 bool is_write = pkt->isWrite();
157 unsigned size = pkt->getSize();
158 Addr addr = pkt->getAddr();
159 bool expects_response = pkt->needsResponse() && !pkt->cacheResponding();
160 std::unique_ptr pkt_data;
160 std::unique_ptr<uint8_t[]> pkt_data;
161 MemCheckerMonitorSenderState* state = NULL;
162
163 if (expects_response && is_write) {
164 // On receipt of a request, only need to allocate pkt_data if this is a
165 // write. For reads, we have no data yet, so it doesn't make sense to
166 // allocate.
167 pkt_data.reset(new uint8_t[size]);
168 memcpy(pkt_data.get(), pkt->getConstPtr<uint8_t*>(), size);

--- 72 unchanged lines hidden (view full) ---

241
242 // Store relevant fields of packet, because packet may be modified
243 // or even deleted when sendTiming() is called.
244 bool is_read = pkt->isRead() && !pkt->req->isPrefetch();
245 bool is_write = pkt->isWrite();
246 bool is_failed_LLSC = pkt->isLLSC() && pkt->req->getExtraData() == 0;
247 unsigned size = pkt->getSize();
248 Addr addr = pkt->getAddr();
161 MemCheckerMonitorSenderState* state = NULL;
162
163 if (expects_response && is_write) {
164 // On receipt of a request, only need to allocate pkt_data if this is a
165 // write. For reads, we have no data yet, so it doesn't make sense to
166 // allocate.
167 pkt_data.reset(new uint8_t[size]);
168 memcpy(pkt_data.get(), pkt->getConstPtr<uint8_t*>(), size);

--- 72 unchanged lines hidden (view full) ---

241
242 // Store relevant fields of packet, because packet may be modified
243 // or even deleted when sendTiming() is called.
244 bool is_read = pkt->isRead() && !pkt->req->isPrefetch();
245 bool is_write = pkt->isWrite();
246 bool is_failed_LLSC = pkt->isLLSC() && pkt->req->getExtraData() == 0;
247 unsigned size = pkt->getSize();
248 Addr addr = pkt->getAddr();
249 std::unique_ptr pkt_data;
249 std::unique_ptr<uint8_t[]> pkt_data;
250 MemCheckerMonitorSenderState* received_state = NULL;
251
252 if (is_read) {
253 // On receipt of a response, only need to allocate pkt_data if this is
254 // a read. For writes, we have already given the MemChecker the data on
255 // the request, so it doesn't make sense to allocate on write.
256 pkt_data.reset(new uint8_t[size]);
257 memcpy(pkt_data.get(), pkt->getConstPtr<uint8_t*>(), size);

--- 117 unchanged lines hidden ---
250 MemCheckerMonitorSenderState* received_state = NULL;
251
252 if (is_read) {
253 // On receipt of a response, only need to allocate pkt_data if this is
254 // a read. For writes, we have already given the MemChecker the data on
255 // the request, so it doesn't make sense to allocate on write.
256 pkt_data.reset(new uint8_t[size]);
257 memcpy(pkt_data.get(), pkt->getConstPtr<uint8_t*>(), size);

--- 117 unchanged lines hidden ---