From daaae3744d119de836d5260205dd34990e741608 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Fri, 21 Aug 2015 07:03:27 -0400 Subject: mem: Reflect that packet address and size are always valid This patch simplifies the packet, and removes the possibility of creating a packet without a valid address and/or size. Under no circumstances are these fields set at a later point, and thus they really have to be provided at construction time. The patch also fixes a case there the MinorCPU creates a packet without a valid address and size, only to later delete it. --- src/cpu/minor/lsq.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/cpu/minor') diff --git a/src/cpu/minor/lsq.cc b/src/cpu/minor/lsq.cc index db57daa37..376e8a0ff 100644 --- a/src/cpu/minor/lsq.cc +++ b/src/cpu/minor/lsq.cc @@ -1578,6 +1578,12 @@ LSQ::LSQRequest::makePacket() if (packet) return; + // if the translation faulted, do not create a packet + if (fault != NoFault) { + assert(packet == NULL); + return; + } + packet = makePacketForRequest(request, isLoad, this, data); /* Null the ret data so we know not to deallocate it when the * ret is destroyed. The data now belongs to the ret and -- cgit v1.2.3