summaryrefslogtreecommitdiff
path: root/src/mem/port_proxy.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-01-22 05:00:53 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2015-01-22 05:00:53 -0500
commitf49830ce0ba79c54c65c9c4b25bc3c6184aaf2a9 (patch)
tree00b2f9f0131ef65a411c9fd81339caecfc946b47 /src/mem/port_proxy.cc
parentbe3a952394e1f337d1c372448ee099203336181a (diff)
downloadgem5-f49830ce0ba79c54c65c9c4b25bc3c6184aaf2a9.tar.xz
mem: Clean up Request initialisation
This patch tidies up how we create and set the fields of a Request. In essence it tries to use the constructor where possible (as opposed to setPhys and setVirt), thus avoiding spreading the information across a number of locations. In fact, setPhys is made private as part of this patch, and a number of places where we callede setVirt instead uses the appropriate constructor.
Diffstat (limited to 'src/mem/port_proxy.cc')
-rw-r--r--src/mem/port_proxy.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mem/port_proxy.cc b/src/mem/port_proxy.cc
index cce8f6ff4..f0158ec2d 100644
--- a/src/mem/port_proxy.cc
+++ b/src/mem/port_proxy.cc
@@ -43,11 +43,9 @@
void
PortProxy::readBlob(Addr addr, uint8_t *p, int size) const
{
- Request req;
-
for (ChunkGenerator gen(addr, size, _cacheLineSize); !gen.done();
gen.next()) {
- req.setPhys(gen.addr(), gen.size(), 0, Request::funcMasterId);
+ Request req(gen.addr(), gen.size(), 0, Request::funcMasterId);
Packet pkt(&req, MemCmd::ReadReq);
pkt.dataStatic(p);
_port.sendFunctional(&pkt);
@@ -58,11 +56,9 @@ PortProxy::readBlob(Addr addr, uint8_t *p, int size) const
void
PortProxy::writeBlob(Addr addr, const uint8_t *p, int size) const
{
- Request req;
-
for (ChunkGenerator gen(addr, size, _cacheLineSize); !gen.done();
gen.next()) {
- req.setPhys(gen.addr(), gen.size(), 0, Request::funcMasterId);
+ Request req(gen.addr(), gen.size(), 0, Request::funcMasterId);
Packet pkt(&req, MemCmd::WriteReq);
pkt.dataStaticConst(p);
_port.sendFunctional(&pkt);