summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorRon Dreslinski <rdreslin@umich.edu>2006-10-25 14:14:37 -0400
committerRon Dreslinski <rdreslin@umich.edu>2006-10-25 14:14:37 -0400
commiteda7148af25e8e106e8983fb37952263dcae5275 (patch)
tree9c9410668b2422bb5536426020101c4119f5c8b9 /src/mem
parent86bd01dfc99e4bb40b5d7266e12b843285847c7c (diff)
downloadgem5-eda7148af25e8e106e8983fb37952263dcae5275.tar.xz
Fix fixPacket functionality to calculate sizes properly
src/mem/packet.cc: Copy size is calculated by END-BEGIN not BEGIN-END --HG-- extra : convert_revision : 0e2725c5551f8f70ff05cb285e0822afc0bb3f87
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/packet.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mem/packet.cc b/src/mem/packet.cc
index fa8d82c46..a342af634 100644
--- a/src/mem/packet.cc
+++ b/src/mem/packet.cc
@@ -182,11 +182,11 @@ fixPacket(PacketPtr func, PacketPtr timing)
if (funcStart >= timingStart) {
memcpy(timing->getPtr<uint8_t>() + (funcStart - timingStart),
func->getPtr<uint8_t>(),
- funcStart - std::min(funcEnd, timingEnd));
+ std::min(funcEnd, timingEnd) - funcStart);
} else { // timingStart > funcStart
memcpy(timing->getPtr<uint8_t>(),
func->getPtr<uint8_t>() + (timingStart - funcStart),
- timingStart - std::min(funcEnd, timingEnd));
+ std::min(funcEnd, timingEnd) - timingStart);
}
// we always want to keep going with a write
return true;