summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2006-10-12 15:30:30 -0400
committerAli Saidi <saidi@eecs.umich.edu>2006-10-12 15:30:30 -0400
commit3d2764acf3a05a65c32e93bd18c8fe9a6e0d9ecc (patch)
tree7b105d8d263b297c542003fb3f8eebe85f010992 /src
parente11c0d380a44ef13a6d53a5e17a14749da04d1cf (diff)
downloadgem5-3d2764acf3a05a65c32e93bd18c8fe9a6e0d9ecc.tar.xz
replace functional code in tport with fixPacket().
fixPacket() should be used anywhere a functional packet and timing packet are found to have the same address. --HG-- extra : convert_revision : 783ec438271b24ddb0ae742b4efd1ed7d6be93f3
Diffstat (limited to 'src')
-rw-r--r--src/mem/tport.cc36
1 files changed, 7 insertions, 29 deletions
diff --git a/src/mem/tport.cc b/src/mem/tport.cc
index 50aab31c4..21907c0ca 100644
--- a/src/mem/tport.cc
+++ b/src/mem/tport.cc
@@ -36,41 +36,19 @@ SimpleTimingPort::recvFunctional(Packet *pkt)
//First check queued events
std::list<Packet *>::iterator i = transmitList.begin();
std::list<Packet *>::iterator end = transmitList.end();
- for (; i != end; ++i) {
+ bool cont = true;
+
+ while (i != end && cont) {
Packet * target = *i;
// If the target contains data, and it overlaps the
// probed request, need to update data
- if (target->intersect(pkt)) {
- uint8_t* pkt_data;
- uint8_t* write_data;
- int data_size;
- if (target->getAddr() < pkt->getAddr()) {
- int offset = pkt->getAddr() - target->getAddr();
- pkt_data = pkt->getPtr<uint8_t>();
- write_data = target->getPtr<uint8_t>() + offset;
- data_size = target->getSize() - offset;
- assert(data_size > 0);
- if (data_size > pkt->getSize())
- data_size = pkt->getSize();
- } else {
- int offset = target->getAddr() - pkt->getAddr();
- pkt_data = pkt->getPtr<uint8_t>() + offset;
- write_data = target->getPtr<uint8_t>();
- data_size = pkt->getSize() - offset;
- assert(data_size > pkt->getSize());
- if (data_size > target->getSize())
- data_size = target->getSize();
- }
+ if (target->intersect(pkt))
+ fixPacket(pkt, target);
- if (pkt->isWrite()) {
- memcpy(pkt_data, write_data, data_size);
- } else {
- memcpy(write_data, pkt_data, data_size);
- }
- }
}
//Then just do an atomic access and throw away the returned latency
- recvAtomic(pkt);
+ if (cont)
+ recvAtomic(pkt);
}
bool