base.cc (12754:15c1d281ce1a) | base.cc (12766:1c347e60c7fd) |
---|---|
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 --- 822 unchanged lines hidden (view full) --- 831 // Read requester(s) to have buffered the ReadEx snoop and to 832 // invalidate their blocks after receiving them. 833 // assert(!pkt->needsWritable() || blk->isWritable()); 834 assert(pkt->getOffset(blkSize) + pkt->getSize() <= blkSize); 835 836 // Check RMW operations first since both isRead() and 837 // isWrite() will be true for them 838 if (pkt->cmd == MemCmd::SwapReq) { | 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 --- 822 unchanged lines hidden (view full) --- 831 // Read requester(s) to have buffered the ReadEx snoop and to 832 // invalidate their blocks after receiving them. 833 // assert(!pkt->needsWritable() || blk->isWritable()); 834 assert(pkt->getOffset(blkSize) + pkt->getSize() <= blkSize); 835 836 // Check RMW operations first since both isRead() and 837 // isWrite() will be true for them 838 if (pkt->cmd == MemCmd::SwapReq) { |
839 cmpAndSwap(blk, pkt); | 839 if (pkt->isAtomicOp()) { 840 // extract data from cache and save it into the data field in 841 // the packet as a return value from this atomic op 842 843 int offset = tags->extractBlkOffset(pkt->getAddr()); 844 uint8_t *blk_data = blk->data + offset; 845 std::memcpy(pkt->getPtr<uint8_t>(), blk_data, pkt->getSize()); 846 847 // execute AMO operation 848 (*(pkt->getAtomicOp()))(blk_data); 849 850 // set block status to dirty 851 blk->status |= BlkDirty; 852 } else { 853 cmpAndSwap(blk, pkt); 854 } |
840 } else if (pkt->isWrite()) { 841 // we have the block in a writable state and can go ahead, 842 // note that the line may be also be considered writable in 843 // downstream caches along the path to memory, but always 844 // Exclusive, and never Modified 845 assert(blk->isWritable()); 846 // Write or WriteLine at the first cache with block in writable state 847 if (blk->checkWrite(pkt)) { --- 1485 unchanged lines hidden --- | 855 } else if (pkt->isWrite()) { 856 // we have the block in a writable state and can go ahead, 857 // note that the line may be also be considered writable in 858 // downstream caches along the path to memory, but always 859 // Exclusive, and never Modified 860 assert(blk->isWritable()); 861 // Write or WriteLine at the first cache with block in writable state 862 if (blk->checkWrite(pkt)) { --- 1485 unchanged lines hidden --- |