addr_mapper.cc (9406:024edfcfcbbf) addr_mapper.cc (9542:683991c46ac8)
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();
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) {
126
127 if (needsResponse && !memInhibitAsserted) {
129 pkt->senderState = new AddrMapperSenderState(senderState, orig_addr);
128 pkt->pushSenderState(new AddrMapperSenderState(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) {
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) {
140 delete pkt->senderState;
141 pkt->senderState = senderState;
139 delete pkt->popSenderState();
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
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
161 pkt->senderState = receivedState->origSenderState;
159 pkt->senderState = receivedState->predecessor;
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 ---
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 ---