summaryrefslogtreecommitdiff
path: root/src/mem/cache
diff options
context:
space:
mode:
authorDaniel R. Carvalho <odanrc@yahoo.com.br>2018-10-15 11:48:32 +0200
committerDaniel Carvalho <odanrc@yahoo.com.br>2018-11-05 13:35:23 +0000
commitadde4c91f99fa99abbdd23cf97c45de020429d2d (patch)
treedcc5f09c9c708cd1c3cb0e8295bab2ec4d67ec97 /src/mem/cache
parent49798e0eface6ad81f6227ea54980268656819c0 (diff)
downloadgem5-adde4c91f99fa99abbdd23cf97c45de020429d2d.tar.xz
mem: Use Packet writing functions instead of memcpy
Classes were using memcpy instead of the Packet functions created for writing to/from the packet. This allows these writes to be better checked and tracked. This also fixes a bug in MemCheckerMonitor, which was using the incorrect type for the packet pointer. Change-Id: I5bbc8a24e59464e8219bb6d54af8209e6d4ee1af Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/13695 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache')
-rw-r--r--src/mem/cache/base.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 6f3914ccd..a7c210697 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -861,10 +861,9 @@ BaseCache::satisfyRequest(PacketPtr pkt, CacheBlk *blk, bool, bool)
if (pkt->isAtomicOp()) {
// extract data from cache and save it into the data field in
// the packet as a return value from this atomic op
-
int offset = tags->extractBlkOffset(pkt->getAddr());
uint8_t *blk_data = blk->data + offset;
- std::memcpy(pkt->getPtr<uint8_t>(), blk_data, pkt->getSize());
+ pkt->setData(blk_data);
// execute AMO operation
(*(pkt->getAtomicOp()))(blk_data);