summaryrefslogtreecommitdiff
path: root/src/mem/request.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2013-10-15 13:26:34 +0200
committerAndreas Sandberg <andreas@sandberg.pp.se>2013-10-15 13:26:34 +0200
commit4f5775df64b1b16ef4a3a02b12e4ac8a6370baed (patch)
tree6933585e3ec5438884333dbe73d82c537ef3abb2 /src/mem/request.hh
parent5e7738467bbc928ff163afc5b94c81385cc6778e (diff)
downloadgem5-4f5775df64b1b16ef4a3a02b12e4ac8a6370baed.tar.xz
mem: Rename the ASI_BITS flag field in Request
ASI_BITS in the Request object were originally used to store a memory request's ASI on SPARC. This is not the case any more since other ISAs use the ASI bits to store architecture-dependent information. This changeset renames the ASI_BITS to ARCH_BITS which better describes their use. Additionally, the getAsi() accessor is renamed to getArchFlags().
Diffstat (limited to 'src/mem/request.hh')
-rw-r--r--src/mem/request.hh28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/mem/request.hh b/src/mem/request.hh
index c3a3f47dc..f37e34dd4 100644
--- a/src/mem/request.hh
+++ b/src/mem/request.hh
@@ -86,10 +86,17 @@ class Request
{
public:
typedef uint32_t FlagsType;
+ typedef uint8_t ArchFlagsType;
typedef ::Flags<FlagsType> Flags;
- /** ASI information for this request if it exists. */
- static const FlagsType ASI_BITS = 0x000000FF;
+ /**
+ * Architecture specific flags.
+ *
+ * These bits int the flag field are reserved for
+ * architecture-specific code. For example, SPARC uses them to
+ * represent ASIs.
+ */
+ static const FlagsType ARCH_BITS = 0x000000FF;
/** The request was an instruction fetch. */
static const FlagsType INST_FETCH = 0x00000100;
/** The virtual address is also the physical address. */
@@ -422,6 +429,13 @@ class Request
_flags.set(flags);
}
+ void
+ setArchFlags(Flags flags)
+ {
+ assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
+ _flags.set(flags & ARCH_BITS);
+ }
+
/** Accessor function for vaddr.*/
Addr
getVaddr()
@@ -452,12 +466,12 @@ class Request
_asid = asid;
}
- /** Accessor function for asi.*/
- uint8_t
- getAsi()
+ /** Accessor function for architecture-specific flags.*/
+ ArchFlagsType
+ getArchFlags()
{
- assert(privateFlags.isSet(VALID_VADDR));
- return _flags & ASI_BITS;
+ assert(privateFlags.isSet(VALID_PADDR|VALID_VADDR));
+ return _flags & ARCH_BITS;
}
/** Accessor function to check if sc result is valid. */