summaryrefslogtreecommitdiff
path: root/src/mem/packet.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2009-04-20 18:40:00 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2009-04-20 18:40:00 -0700
commit7f8ea68a309790821d81500d1ba15d4ceef25933 (patch)
tree57acd765db8034a8a16cdd15eea8d7495f1d0671 /src/mem/packet.hh
parent9e9a34fed1013fa8cd124d3db65c4ca4979bedf2 (diff)
downloadgem5-7f8ea68a309790821d81500d1ba15d4ceef25933.tar.xz
request: split public and private flags into separate fields.
This frees up needed space for more public flags. Also: - remove unused Request accessor methods - make Packet use public Request accessors, so it need not be a friend
Diffstat (limited to 'src/mem/packet.hh')
-rw-r--r--src/mem/packet.hh32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/mem/packet.hh b/src/mem/packet.hh
index b06f53336..eaffd530e 100644
--- a/src/mem/packet.hh
+++ b/src/mem/packet.hh
@@ -462,11 +462,16 @@ class Packet : public FastAlloc, public Printable
*/
Packet(Request *_req, MemCmd _cmd, NodeID _dest)
: flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
- addr(_req->paddr), size(_req->size), dest(_dest), time(curTick),
- senderState(NULL)
+ dest(_dest), time(curTick), senderState(NULL)
{
- if (req->flags.isSet(Request::VALID_PADDR))
- flags.set(VALID_ADDR|VALID_SIZE);
+ if (req->hasPaddr()) {
+ addr = req->getPaddr();
+ flags.set(VALID_ADDR);
+ }
+ if (req->hasSize()) {
+ size = req->getSize();
+ flags.set(VALID_SIZE);
+ }
}
/**
@@ -476,11 +481,14 @@ class Packet : public FastAlloc, public Printable
*/
Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize)
: flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
- addr(_req->paddr & ~(_blkSize - 1)), size(_blkSize), dest(_dest),
- time(curTick), senderState(NULL)
+ dest(_dest), time(curTick), senderState(NULL)
{
- if (req->flags.isSet(Request::VALID_PADDR))
- flags.set(VALID_ADDR|VALID_SIZE);
+ if (req->hasPaddr()) {
+ addr = req->getPaddr() & ~(_blkSize - 1);
+ flags.set(VALID_ADDR);
+ }
+ size = _blkSize;
+ flags.set(VALID_SIZE);
}
/**
@@ -526,11 +534,11 @@ class Packet : public FastAlloc, public Printable
void
reinitFromRequest()
{
- assert(req->flags.isSet(Request::VALID_PADDR));
+ assert(req->hasPaddr());
flags = 0;
- addr = req->paddr;
- size = req->size;
- time = req->time;
+ addr = req->getPaddr();
+ size = req->getSize();
+ time = req->getTime();
flags.set(VALID_ADDR|VALID_SIZE);
deleteData();