Deleted Added
sdiff udiff text old ( 12425:7f8c9032b18c ) new ( 12500:a91cf4e8b6a4 )
full compact
1/*
2 * Copyright (c) 2010-2017 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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

400 blk->status = (BlkValid | BlkReadable);
401 if (pkt->isSecure()) {
402 blk->status |= BlkSecure;
403 }
404 }
405 // only mark the block dirty if we got a writeback command,
406 // and leave it as is for a clean writeback
407 if (pkt->cmd == MemCmd::WritebackDirty) {
408 blk->status |= BlkDirty;
409 }
410 // if the packet does not have sharers, it is passing
411 // writable, and we got the writeback in Modified or Exclusive
412 // state, if not we are in the Owned or Shared state
413 if (!pkt->hasSharers()) {
414 blk->status |= BlkWritable;
415 }

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

462 }
463 }
464 }
465
466 // at this point either this is a writeback or a write-through
467 // write clean operation and the block is already in this
468 // cache, we need to update the data and the block flags
469 assert(blk);
470 if (!pkt->writeThrough()) {
471 blk->status |= BlkDirty;
472 }
473 // nothing else to do; writeback doesn't expect response
474 assert(!pkt->needsResponse());
475 std::memcpy(blk->data, pkt->getConstPtr<uint8_t>(), blkSize);
476 DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print());
477

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

1692Cache::writecleanBlk(CacheBlk *blk, Request::Flags dest, PacketId id)
1693{
1694 Request *req = new Request(tags->regenerateBlkAddr(blk->tag, blk->set),
1695 blkSize, 0, Request::wbMasterId);
1696 if (blk->isSecure()) {
1697 req->setFlags(Request::SECURE);
1698 }
1699 req->taskId(blk->task_id);
1700 blk->task_id = ContextSwitchTaskId::Unknown;
1701 PacketPtr pkt = new Packet(req, MemCmd::WriteClean, blkSize, id);
1702 DPRINTF(Cache, "Create %s writable: %d, dirty: %d\n", pkt->print(),
1703 blk->isWritable(), blk->isDirty());
1704 // make sure the block is not marked dirty
1705 blk->status &= ~BlkDirty;
1706 pkt->allocate();
1707 // We inform the cache below that the block has sharers in the
1708 // system as we retain our copy.
1709 pkt->setHasSharers();
1710 if (dest) {
1711 req->setFlags(dest);
1712 pkt->setWriteThrough();
1713 }
1714 std::memcpy(pkt->getPtr<uint8_t>(), blk->data, blkSize);
1715 return pkt;
1716}
1717
1718
1719PacketPtr
1720Cache::cleanEvictBlk(CacheBlk *blk)
1721{
1722 assert(!writebackClean);

--- 1151 unchanged lines hidden ---