summaryrefslogtreecommitdiff
path: root/src/dev/alpha
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-12-02 06:07:41 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2014-12-02 06:07:41 -0500
commit5df96cb690168d750ab0fafffd11fb51624374d2 (patch)
treeb8345b3c1b9f5a998a6eca8d68aa0022086b604d /src/dev/alpha
parent0706a252031b3f160bac65fac00b22f8a5ebf4f9 (diff)
downloadgem5-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/alpha')
-rw-r--r--src/dev/alpha/backdoor.cc1
-rw-r--r--src/dev/alpha/tsunami_cchip.cc1
-rw-r--r--src/dev/alpha/tsunami_io.cc2
-rw-r--r--src/dev/alpha/tsunami_pchip.cc1
4 files changed, 0 insertions, 5 deletions
diff --git a/src/dev/alpha/backdoor.cc b/src/dev/alpha/backdoor.cc
index dc0e8e49f..598620893 100644
--- a/src/dev/alpha/backdoor.cc
+++ b/src/dev/alpha/backdoor.cc
@@ -111,7 +111,6 @@ AlphaBackdoor::read(PacketPtr pkt)
Addr daddr = pkt->getAddr() - pioAddr;
- pkt->allocate();
pkt->makeAtomicResponse();
switch (pkt->getSize())
diff --git a/src/dev/alpha/tsunami_cchip.cc b/src/dev/alpha/tsunami_cchip.cc
index 203325e75..7416de403 100644
--- a/src/dev/alpha/tsunami_cchip.cc
+++ b/src/dev/alpha/tsunami_cchip.cc
@@ -83,7 +83,6 @@ TsunamiCChip::read(PacketPtr pkt)
Addr regnum = (pkt->getAddr() - pioAddr) >> 6;
Addr daddr = (pkt->getAddr() - pioAddr);
- pkt->allocate();
switch (pkt->getSize()) {
case sizeof(uint64_t):
diff --git a/src/dev/alpha/tsunami_io.cc b/src/dev/alpha/tsunami_io.cc
index 6586cd980..2c503880f 100644
--- a/src/dev/alpha/tsunami_io.cc
+++ b/src/dev/alpha/tsunami_io.cc
@@ -96,8 +96,6 @@ TsunamiIO::read(PacketPtr pkt)
DPRINTF(Tsunami, "io read va=%#x size=%d IOPorrt=%#x\n", pkt->getAddr(),
pkt->getSize(), daddr);
- pkt->allocate();
-
if (pkt->getSize() == sizeof(uint8_t)) {
switch(daddr) {
// PIC1 mask read
diff --git a/src/dev/alpha/tsunami_pchip.cc b/src/dev/alpha/tsunami_pchip.cc
index 3ddc0f1b3..328699f9f 100644
--- a/src/dev/alpha/tsunami_pchip.cc
+++ b/src/dev/alpha/tsunami_pchip.cc
@@ -72,7 +72,6 @@ TsunamiPChip::read(PacketPtr pkt)
{
assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr + pioSize);
- pkt->allocate();
Addr daddr = (pkt->getAddr() - pioAddr) >> 6;;
assert(pkt->getSize() == sizeof(uint64_t));