Merge zizzer:/bk/newmem
authorRon Dreslinski <rdreslin@umich.edu>
Fri, 20 Oct 2006 17:04:59 +0000 (13:04 -0400)
committerRon Dreslinski <rdreslin@umich.edu>
Fri, 20 Oct 2006 17:04:59 +0000 (13:04 -0400)
into  zazzer.eecs.umich.edu:/z/rdreslin/m5bk/newmemcleanest

src/mem/tport.cc:
    Merge PacketPtr changes

--HG--
extra : convert_revision : 0329c5803a3df67af3dda89bd9d4753fd1a286d1

1  2 
src/cpu/memtest/memtest.cc
src/cpu/memtest/memtest.hh
src/mem/cache/base_cache.cc
src/mem/cache/cache_impl.hh
src/mem/packet.cc
src/mem/tport.cc

Simple merge
Simple merge
Simple merge
index dcb0e7b787bbdbb236ab31261021a1bec47c7348,a88aeb573d0c4c770bafcbd8f3afea29f5aa3f05..66a9ee55469545bb6c5e7c953d118e76e5a17e6f
@@@ -565,74 -564,18 +564,18 @@@ Cache<TagStore,Buffering,Coherence>::pr
              MSHR::TargetList::iterator i = targets->begin();
              MSHR::TargetList::iterator end = targets->end();
              for (; i != end; ++i) {
 -                Packet * target = *i;
 +                PacketPtr target = *i;
                  // If the target contains data, and it overlaps the
                  // probed request, need to update data
-                 if (target->isWrite() && 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 (pkt->isWrite()) {
-                         memcpy(pkt_data, write_data, data_size);
-                     } else {
-                         pkt->flags |= SATISFIED;
-                         pkt->result = Packet::Success;
-                         memcpy(write_data, pkt_data, data_size);
-                     }
+                 if (target->intersect(pkt)) {
+                     fixPacket(pkt, target);
                  }
              }
          }
          for (int i = 0; i < writes.size(); ++i) {
 -            Packet * write = writes[i]->pkt;
 +            PacketPtr write = writes[i]->pkt;
              if (write->intersect(pkt)) {
-                 warn("Found outstanding write on an non-update probe");
-                 uint8_t* pkt_data;
-                 uint8_t* write_data;
-                 int data_size;
-                 if (write->getAddr() < pkt->getAddr()) {
-                     int offset = pkt->getAddr() - write->getAddr();
-                     pkt_data = pkt->getPtr<uint8_t>();
-                     write_data = write->getPtr<uint8_t>() + offset;
-                     data_size = write->getSize() - offset;
-                     assert(data_size > 0);
-                     if (data_size > pkt->getSize())
-                         data_size = pkt->getSize();
-                 } else {
-                     int offset = write->getAddr() - pkt->getAddr();
-                     pkt_data = pkt->getPtr<uint8_t>() + offset;
-                     write_data = write->getPtr<uint8_t>();
-                     data_size = pkt->getSize() - offset;
-                     assert(data_size >= pkt->getSize());
-                     if (data_size > write->getSize())
-                         data_size = write->getSize();
-                 }
-                 if (pkt->isWrite()) {
-                     memcpy(pkt_data, write_data, data_size);
-                 } else {
-                     pkt->flags |= SATISFIED;
-                     pkt->result = Packet::Success;
-                     memcpy(write_data, pkt_data, data_size);
-                 }
+                 fixPacket(pkt, write);
              }
          }
          if (pkt->isRead()
Simple merge
index 350b4c8e353168d438e09a5674e232b061cf6475,479dca1ad160ba9dfb08eaf9e8cf51fd0fd4d379..5c5aaa3da506f1b1446013ebd9c36618615330c3
  #include "mem/tport.hh"
  
  void
 -SimpleTimingPort::recvFunctional(Packet *pkt)
 +SimpleTimingPort::recvFunctional(PacketPtr pkt)
  {
-     //First check queued events
 -    std::list<Packet *>::iterator i;
 -    std::list<Packet *>::iterator end;
 +    std::list<PacketPtr>::iterator i = transmitList.begin();
 +    std::list<PacketPtr>::iterator end = transmitList.end();
 +    bool cont = true;
  
-     while (i != end && cont) {
 -     //First check queued events
 -    i = transmitList.begin();
 -    end = transmitList.end();
+     while (i != end) {
 -        Packet * target = *i;
 +        PacketPtr target = *i;
          // If the target contains data, and it overlaps the
          // probed request, need to update data
          if (target->intersect(pkt))