Deleted Added
sdiff udiff text old ( 9406:024edfcfcbbf ) new ( 9542:683991c46ac8 )
full compact
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 Packet::SenderState* senderState = pkt->senderState;
127
128 if (needsResponse && !memInhibitAsserted) {
129 pkt->senderState = new AddrMapperSenderState(senderState, orig_addr);
130 }
131
132 pkt->setAddr(remapAddr(orig_addr));
133
134 // Attempt to send the packet (always succeeds for inhibited
135 // packets)
136 bool successful = masterPort.sendTimingReq(pkt);
137
138 // If not successful, restore the sender state
139 if (!successful && needsResponse) {
140 delete pkt->senderState;
141 pkt->senderState = senderState;
142 }
143
144 return successful;
145}
146
147bool
148AddrMapper::recvTimingResp(PacketPtr pkt)
149{
150 AddrMapperSenderState* receivedState =
151 dynamic_cast<AddrMapperSenderState*>(pkt->senderState);
152
153 // Restore initial sender state
154 if (receivedState == NULL)
155 panic("AddrMapper %s got a response without sender state\n",
156 name());
157
158 Addr remapped_addr = pkt->getAddr();
159
160 // Restore the state and address
161 pkt->senderState = receivedState->origSenderState;
162 pkt->setAddr(receivedState->origAddr);
163
164 // Attempt to send the packet
165 bool successful = slavePort.sendTimingResp(pkt);
166
167 // If packet successfully sent, delete the sender state, otherwise
168 // restore state
169 if (successful) {

--- 104 unchanged lines hidden ---