From 53e777d6838ac3ca80e6557626f9e99fd93dd0f7 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 7 Aug 2015 09:59:13 +0100 Subject: base: Declare a type for context IDs Context IDs used to be declared as ad hoc (usually as int). This changeset introduces a typedef for ContextIDs and a constant for invalid context IDs. --- src/mem/cache/blk.hh | 2 +- src/mem/cache/cache_impl.hh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mem/cache') diff --git a/src/mem/cache/blk.hh b/src/mem/cache/blk.hh index 0be22f45d..2b3a34bb8 100644 --- a/src/mem/cache/blk.hh +++ b/src/mem/cache/blk.hh @@ -130,7 +130,7 @@ class CacheBlk */ class Lock { public: - int contextId; // locking context + ContextID contextId; // locking context Addr lowAddr; // low address of lock range Addr highAddr; // high address of lock range diff --git a/src/mem/cache/cache_impl.hh b/src/mem/cache/cache_impl.hh index 62ab49538..dea95d955 100644 --- a/src/mem/cache/cache_impl.hh +++ b/src/mem/cache/cache_impl.hh @@ -332,7 +332,8 @@ Cache::access(PacketPtr pkt, CacheBlk *&blk, Cycles &lat, return false; } - int id = pkt->req->hasContextId() ? pkt->req->contextId() : -1; + ContextID id = pkt->req->hasContextId() ? + pkt->req->contextId() : InvalidContextID; // Here lat is the value passed as parameter to accessBlock() function // that can modify its value. blk = tags->accessBlock(pkt->getAddr(), pkt->isSecure(), lat, id); -- cgit v1.2.3