abstract_mem.hh (12748:ae5ce8e42de7) | abstract_mem.hh (12749:223c83ed9979) |
---|---|
1/* 2 * Copyright (c) 2012 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 --- 65 unchanged lines hidden (view full) --- 74 Addr addr; 75 76 // locking hw context 77 const ContextID contextId; 78 79 static Addr mask(Addr paddr) { return (paddr & ~Addr_Mask); } 80 81 // check for matching execution context | 1/* 2 * Copyright (c) 2012 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 --- 65 unchanged lines hidden (view full) --- 74 Addr addr; 75 76 // locking hw context 77 const ContextID contextId; 78 79 static Addr mask(Addr paddr) { return (paddr & ~Addr_Mask); } 80 81 // check for matching execution context |
82 bool matchesContext(RequestPtr req) const | 82 bool matchesContext(const RequestPtr &req) const |
83 { 84 return (contextId == req->contextId()); 85 } 86 | 83 { 84 return (contextId == req->contextId()); 85 } 86 |
87 LockedAddr(RequestPtr req) : addr(mask(req->getPaddr())), 88 contextId(req->contextId()) | 87 LockedAddr(const RequestPtr &req) : addr(mask(req->getPaddr())), 88 contextId(req->contextId()) |
89 {} 90 91 // constructor for unserialization use 92 LockedAddr(Addr _addr, int _cid) : addr(_addr), contextId(_cid) 93 {} 94}; 95 96/** --- 38 unchanged lines hidden (view full) --- 135 // Compare a store address with any locked addresses so we can 136 // clear the lock flag appropriately. Return value set to 'false' 137 // if store operation should be suppressed (because it was a 138 // conditional store and the address was no longer locked by the 139 // requesting execution context), 'true' otherwise. Note that 140 // this method must be called on *all* stores since even 141 // non-conditional stores must clear any matching lock addresses. 142 bool writeOK(PacketPtr pkt) { | 89 {} 90 91 // constructor for unserialization use 92 LockedAddr(Addr _addr, int _cid) : addr(_addr), contextId(_cid) 93 {} 94}; 95 96/** --- 38 unchanged lines hidden (view full) --- 135 // Compare a store address with any locked addresses so we can 136 // clear the lock flag appropriately. Return value set to 'false' 137 // if store operation should be suppressed (because it was a 138 // conditional store and the address was no longer locked by the 139 // requesting execution context), 'true' otherwise. Note that 140 // this method must be called on *all* stores since even 141 // non-conditional stores must clear any matching lock addresses. 142 bool writeOK(PacketPtr pkt) { |
143 RequestPtr req = pkt->req; | 143 const RequestPtr &req = pkt->req; |
144 if (lockedAddrList.empty()) { 145 // no locked addrs: nothing to check, store_conditional fails 146 bool isLLSC = pkt->isLLSC(); 147 if (isLLSC) { 148 req->setExtraData(0); 149 } 150 return !isLLSC; // only do write if not an sc 151 } else { --- 171 unchanged lines hidden --- | 144 if (lockedAddrList.empty()) { 145 // no locked addrs: nothing to check, store_conditional fails 146 bool isLLSC = pkt->isLLSC(); 147 if (isLLSC) { 148 req->setExtraData(0); 149 } 150 return !isLLSC; // only do write if not an sc 151 } else { --- 171 unchanged lines hidden --- |