physical.hh (4475:fb185cc1c845) | physical.hh (4626:ed8aacb19c03) |
---|---|
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; --- 98 unchanged lines hidden (view full) --- 107 }; 108 109 std::list<LockedAddr> lockedAddrList; 110 111 // helper function for checkLockedAddrs(): we really want to 112 // inline a quick check for an empty locked addr list (hopefully 113 // the common case), and do the full list search (if necessary) in 114 // 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; --- 98 unchanged lines hidden (view full) --- 107 }; 108 109 std::list<LockedAddr> lockedAddrList; 110 111 // helper function for checkLockedAddrs(): we really want to 112 // inline a quick check for an empty locked addr list (hopefully 113 // the common case), and do the full list search (if necessary) in 114 // this out-of-line function |
115 bool checkLockedAddrList(Request *req); | 115 bool checkLockedAddrList(PacketPtr pkt); |
116 117 // Record the address of a load-locked operation so that we can 118 // clear the execution context's lock flag if a matching store is 119 // performed | 116 117 // Record the address of a load-locked operation so that we can 118 // clear the execution context's lock flag if a matching store is 119 // performed |
120 void trackLoadLocked(Request *req); | 120 void trackLoadLocked(PacketPtr pkt); |
121 122 // Compare a store address with any locked addresses so we can 123 // clear the lock flag appropriately. Return value set to 'false' 124 // if store operation should be suppressed (because it was a 125 // conditional store and the address was no longer locked by the 126 // requesting execution context), 'true' otherwise. Note that 127 // this method must be called on *all* stores since even 128 // non-conditional stores must clear any matching lock addresses. | 121 122 // Compare a store address with any locked addresses so we can 123 // clear the lock flag appropriately. Return value set to 'false' 124 // if store operation should be suppressed (because it was a 125 // conditional store and the address was no longer locked by the 126 // requesting execution context), 'true' otherwise. Note that 127 // this method must be called on *all* stores since even 128 // non-conditional stores must clear any matching lock addresses. |
129 bool writeOK(Request *req) { | 129 bool writeOK(PacketPtr pkt) { 130 Request *req = pkt->req; |
130 if (lockedAddrList.empty()) { 131 // no locked addrs: nothing to check, store_conditional fails | 131 if (lockedAddrList.empty()) { 132 // no locked addrs: nothing to check, store_conditional fails |
132 bool isLocked = req->isLocked(); | 133 bool isLocked = pkt->isLocked(); |
133 if (isLocked) { 134 req->setExtraData(0); 135 } 136 return !isLocked; // only do write if not an sc 137 } else { 138 // iterate over list... | 134 if (isLocked) { 135 req->setExtraData(0); 136 } 137 return !isLocked; // only do write if not an sc 138 } else { 139 // iterate over list... |
139 return checkLockedAddrList(req); | 140 return checkLockedAddrList(pkt); |
140 } 141 } 142 143 uint8_t *pmemAddr; 144 int pagePtr; 145 Tick lat; 146 std::vector<MemoryPort*> ports; 147 typedef std::vector<MemoryPort*>::iterator PortIterator; --- 22 unchanged lines hidden (view full) --- 170 public: 171 int deviceBlockSize(); 172 void getAddressRanges(AddrRangeList &resp, bool &snoop); 173 virtual Port *getPort(const std::string &if_name, int idx = -1); 174 void virtual init(); 175 unsigned int drain(Event *de); 176 177 protected: | 141 } 142 } 143 144 uint8_t *pmemAddr; 145 int pagePtr; 146 Tick lat; 147 std::vector<MemoryPort*> ports; 148 typedef std::vector<MemoryPort*>::iterator PortIterator; --- 22 unchanged lines hidden (view full) --- 171 public: 172 int deviceBlockSize(); 173 void getAddressRanges(AddrRangeList &resp, bool &snoop); 174 virtual Port *getPort(const std::string &if_name, int idx = -1); 175 void virtual init(); 176 unsigned int drain(Event *de); 177 178 protected: |
179 Tick doAtomicAccess(PacketPtr pkt); |
|
178 void doFunctionalAccess(PacketPtr pkt); 179 virtual Tick calculateLatency(PacketPtr pkt); 180 void recvStatusChange(Port::Status status); 181 182 public: 183 virtual void serialize(std::ostream &os); 184 virtual void unserialize(Checkpoint *cp, const std::string §ion); 185 186}; 187 188#endif //__PHYSICAL_MEMORY_HH__ | 180 void doFunctionalAccess(PacketPtr pkt); 181 virtual Tick calculateLatency(PacketPtr pkt); 182 void recvStatusChange(Port::Status status); 183 184 public: 185 virtual void serialize(std::ostream &os); 186 virtual void unserialize(Checkpoint *cp, const std::string §ion); 187 188}; 189 190#endif //__PHYSICAL_MEMORY_HH__ |