Merge m5.eecs.umich.edu:/bk/newmem
authorGabe Black <gblack@eecs.umich.edu>
Fri, 28 Apr 2006 18:03:42 +0000 (14:03 -0400)
committerGabe Black <gblack@eecs.umich.edu>
Fri, 28 Apr 2006 18:03:42 +0000 (14:03 -0400)
into  ewok.(none):/home/gblack/m5/newmem

cpu/simple/cpu.cc:
    Hand merged

--HG--
extra : convert_revision : 68414730c23d41c30cfb7bcfa604029a5fc8622c

1  2 
cpu/simple/cpu.cc

index 40b506a787b283ec46595271c5a05ed92c9ead86,1a737fa6aa7016f5d572e5012c2cc81e7bcbac36..be34d1791eca598da06f9e504057faabe733380a
@@@ -480,7 -474,8 +480,7 @@@ SimpleCPU::read(Addr addr, T &data, uns
  //    Fault fault = xc->read(memReq,data);
          // Not sure what to check for no fault...
          if (data_read_pkt->result == Success) {
-             data = data_read_pkt->get<T>();
 -            memcpy(&data, data_read_pkt->data, sizeof(T));
 -            data = gtoh(data);
++            data = gtoh(data_read_pkt->get<T>());
          }
  
          if (traceData) {
          // Need to find a way to not duplicate code above.
  
          if (data_read_pkt->result == Success) {
-             data = data_read_pkt->get<T>();
 -            memcpy(&data, data_read_pkt->data, sizeof(T));
 -            data = gtoh(data);
++            data = gtoh(data_read_pkt->get<T>());
          }
  
          if (traceData) {
@@@ -627,11 -623,13 +627,13 @@@ SimpleCPU::write(T data, Addr addr, uns
          data_write_pkt = new Packet;
          data_write_pkt->cmd = Write;
          data_write_pkt->req = data_write_req;
 -        data_write_pkt->data = new uint8_t[64];
+         T hostData = htog(data);
 -        memcpy(data_write_pkt->data, &hostData, sizeof(T));
 +        data_write_pkt->allocate();
-         data_write_pkt->set(data);
++        data_write_pkt->set(hostData);
  #else
          data_write_pkt->reset();
 -        data_write_pkt->data = (uint8_t *)&data;
+         data = htog(data);
 +        data_write_pkt->dataStatic(&data);
  #endif
          data_write_pkt->addr = data_write_req->getPaddr();
          data_write_pkt->size = sizeof(T);