base.cc (13376:2165f3f012ed) base.cc (13377:2e04ce7d3fd4)
1/*
2 * Copyright (c) 2012-2013, 2018 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

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

856 assert(pkt->getOffset(blkSize) + pkt->getSize() <= blkSize);
857
858 // Check RMW operations first since both isRead() and
859 // isWrite() will be true for them
860 if (pkt->cmd == MemCmd::SwapReq) {
861 if (pkt->isAtomicOp()) {
862 // extract data from cache and save it into the data field in
863 // the packet as a return value from this atomic op
1/*
2 * Copyright (c) 2012-2013, 2018 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

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

856 assert(pkt->getOffset(blkSize) + pkt->getSize() <= blkSize);
857
858 // Check RMW operations first since both isRead() and
859 // isWrite() will be true for them
860 if (pkt->cmd == MemCmd::SwapReq) {
861 if (pkt->isAtomicOp()) {
862 // extract data from cache and save it into the data field in
863 // the packet as a return value from this atomic op
864
865 int offset = tags->extractBlkOffset(pkt->getAddr());
866 uint8_t *blk_data = blk->data + offset;
864 int offset = tags->extractBlkOffset(pkt->getAddr());
865 uint8_t *blk_data = blk->data + offset;
867 std::memcpy(pkt->getPtr<uint8_t>(), blk_data, pkt->getSize());
866 pkt->setData(blk_data);
868
869 // execute AMO operation
870 (*(pkt->getAtomicOp()))(blk_data);
871
872 // set block status to dirty
873 blk->status |= BlkDirty;
874 } else {
875 cmpAndSwap(blk, pkt);

--- 1572 unchanged lines hidden ---
867
868 // execute AMO operation
869 (*(pkt->getAtomicOp()))(blk_data);
870
871 // set block status to dirty
872 blk->status |= BlkDirty;
873 } else {
874 cmpAndSwap(blk, pkt);

--- 1572 unchanged lines hidden ---