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 --- 109 unchanged lines hidden (view full) --- 118} 119 120bool 121AddrMapper::recvTimingReq(PacketPtr pkt) 122{ 123 Addr orig_addr = pkt->getAddr(); 124 bool needsResponse = pkt->needsResponse(); 125 bool memInhibitAsserted = pkt->memInhibitAsserted(); |
126 127 if (needsResponse && !memInhibitAsserted) { |
128 pkt->pushSenderState(new AddrMapperSenderState(orig_addr)); |
129 } 130 131 pkt->setAddr(remapAddr(orig_addr)); 132 133 // Attempt to send the packet (always succeeds for inhibited 134 // packets) 135 bool successful = masterPort.sendTimingReq(pkt); 136 137 // If not successful, restore the sender state 138 if (!successful && needsResponse) { |
139 delete pkt->popSenderState(); |
140 } 141 142 return successful; 143} 144 145bool 146AddrMapper::recvTimingResp(PacketPtr pkt) 147{ 148 AddrMapperSenderState* receivedState = 149 dynamic_cast<AddrMapperSenderState*>(pkt->senderState); 150 151 // Restore initial sender state 152 if (receivedState == NULL) 153 panic("AddrMapper %s got a response without sender state\n", 154 name()); 155 156 Addr remapped_addr = pkt->getAddr(); 157 158 // Restore the state and address |
159 pkt->senderState = receivedState->predecessor; |
160 pkt->setAddr(receivedState->origAddr); 161 162 // Attempt to send the packet 163 bool successful = slavePort.sendTimingResp(pkt); 164 165 // If packet successfully sent, delete the sender state, otherwise 166 // restore state 167 if (successful) { --- 104 unchanged lines hidden --- |