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 int offset = tags->extractBlkOffset(pkt->getAddr()); 865 uint8_t *blk_data = blk->data + offset; |
866 pkt->setData(blk_data); |
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 --- |