diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-12-02 06:07:41 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-12-02 06:07:41 -0500 |
commit | 5df96cb690168d750ab0fafffd11fb51624374d2 (patch) | |
tree | b8345b3c1b9f5a998a6eca8d68aa0022086b604d /src/dev/arm/pl011.cc | |
parent | 0706a252031b3f160bac65fac00b22f8a5ebf4f9 (diff) | |
download | gem5-5df96cb690168d750ab0fafffd11fb51624374d2.tar.xz |
mem: Remove redundant Packet::allocate calls
This patch cleans up the packet memory allocation confusion. The data
is always allocated at the requesting side, when a packet is created
(or copied), and there is never a need for any device to allocate any
space if it is merely responding to a paket. This behaviour is in line
with how SystemC and TLM works as well, thus increasing
interoperability, and matching established conventions.
The redundant calls to Packet::allocate are removed, and the checks in
the function are tightened up to make sure data is only ever allocated
once. There are still some oddities in the packet copy constructor
where we copy the data pointer if it is static (without ownership),
and allocate new space if the data is dynamic (with ownership). The
latter is being worked on further in a follow-on patch.
Diffstat (limited to 'src/dev/arm/pl011.cc')
-rw-r--r-- | src/dev/arm/pl011.cc | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/dev/arm/pl011.cc b/src/dev/arm/pl011.cc index b47d0e9fb..d690ee9cb 100644 --- a/src/dev/arm/pl011.cc +++ b/src/dev/arm/pl011.cc @@ -64,7 +64,6 @@ Pl011::read(PacketPtr pkt) assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr + pioSize); Addr daddr = pkt->getAddr() - pioAddr; - pkt->allocate(); DPRINTF(Uart, " read register %#x size=%d\n", daddr, pkt->getSize()); |