physical.hh (4762:c94e103c83ad) | physical.hh (4918:3214e3694fb2) |
---|---|
1/* 2 * Copyright (c) 2001-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 100 unchanged lines hidden (view full) --- 109 }; 110 111 std::list<LockedAddr> lockedAddrList; 112 113 // helper function for checkLockedAddrs(): we really want to 114 // inline a quick check for an empty locked addr list (hopefully 115 // the common case), and do the full list search (if necessary) in 116 // this out-of-line function | 1/* 2 * Copyright (c) 2001-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 100 unchanged lines hidden (view full) --- 109 }; 110 111 std::list<LockedAddr> lockedAddrList; 112 113 // helper function for checkLockedAddrs(): we really want to 114 // inline a quick check for an empty locked addr list (hopefully 115 // the common case), and do the full list search (if necessary) in 116 // this out-of-line function |
117 bool checkLockedAddrList(Request *req); | 117 bool checkLockedAddrList(PacketPtr pkt); |
118 119 // Record the address of a load-locked operation so that we can 120 // clear the execution context's lock flag if a matching store is 121 // performed | 118 119 // Record the address of a load-locked operation so that we can 120 // clear the execution context's lock flag if a matching store is 121 // performed |
122 void trackLoadLocked(Request *req); | 122 void trackLoadLocked(PacketPtr pkt); |
123 124 // Compare a store address with any locked addresses so we can 125 // clear the lock flag appropriately. Return value set to 'false' 126 // if store operation should be suppressed (because it was a 127 // conditional store and the address was no longer locked by the 128 // requesting execution context), 'true' otherwise. Note that 129 // this method must be called on *all* stores since even 130 // non-conditional stores must clear any matching lock addresses. | 123 124 // Compare a store address with any locked addresses so we can 125 // clear the lock flag appropriately. Return value set to 'false' 126 // if store operation should be suppressed (because it was a 127 // conditional store and the address was no longer locked by the 128 // requesting execution context), 'true' otherwise. Note that 129 // this method must be called on *all* stores since even 130 // non-conditional stores must clear any matching lock addresses. |
131 bool writeOK(Request *req) { | 131 bool writeOK(PacketPtr pkt) { 132 Request *req = pkt->req; |
132 if (lockedAddrList.empty()) { 133 // no locked addrs: nothing to check, store_conditional fails | 133 if (lockedAddrList.empty()) { 134 // no locked addrs: nothing to check, store_conditional fails |
134 bool isLocked = req->isLocked(); | 135 bool isLocked = pkt->isLocked(); |
135 if (isLocked) { 136 req->setExtraData(0); 137 } 138 return !isLocked; // only do write if not an sc 139 } else { 140 // iterate over list... | 136 if (isLocked) { 137 req->setExtraData(0); 138 } 139 return !isLocked; // only do write if not an sc 140 } else { 141 // iterate over list... |
141 return checkLockedAddrList(req); | 142 return checkLockedAddrList(pkt); |
142 } 143 } 144 145 uint8_t *pmemAddr; 146 int pagePtr; 147 Tick lat; 148 std::vector<MemoryPort*> ports; 149 typedef std::vector<MemoryPort*>::iterator PortIterator; --- 17 unchanged lines hidden (view full) --- 167 public: 168 int deviceBlockSize(); 169 void getAddressRanges(AddrRangeList &resp, bool &snoop); 170 virtual Port *getPort(const std::string &if_name, int idx = -1); 171 void virtual init(); 172 unsigned int drain(Event *de); 173 174 protected: | 143 } 144 } 145 146 uint8_t *pmemAddr; 147 int pagePtr; 148 Tick lat; 149 std::vector<MemoryPort*> ports; 150 typedef std::vector<MemoryPort*>::iterator PortIterator; --- 17 unchanged lines hidden (view full) --- 168 public: 169 int deviceBlockSize(); 170 void getAddressRanges(AddrRangeList &resp, bool &snoop); 171 virtual Port *getPort(const std::string &if_name, int idx = -1); 172 void virtual init(); 173 unsigned int drain(Event *de); 174 175 protected: |
176 Tick doAtomicAccess(PacketPtr pkt); |
|
175 void doFunctionalAccess(PacketPtr pkt); 176 virtual Tick calculateLatency(PacketPtr pkt); 177 void recvStatusChange(Port::Status status); 178 179 public: 180 virtual void serialize(std::ostream &os); 181 virtual void unserialize(Checkpoint *cp, const std::string §ion); 182 183}; 184 185#endif //__PHYSICAL_MEMORY_HH__ | 177 void doFunctionalAccess(PacketPtr pkt); 178 virtual Tick calculateLatency(PacketPtr pkt); 179 void recvStatusChange(Port::Status status); 180 181 public: 182 virtual void serialize(std::ostream &os); 183 virtual void unserialize(Checkpoint *cp, const std::string §ion); 184 185}; 186 187#endif //__PHYSICAL_MEMORY_HH__ |