mem-cache: Create an address aware TempCacheBlk
[gem5.git] / src / mem / abstract_mem.hh
index 8ab28770d18b78fdd5979f6a3f8edf095766c801..b57f73b4a53e7cb01aa128cbe5e2edf20df35d5a 100644 (file)
@@ -46,8 +46,8 @@
  * AbstractMemory declaration
  */
 
-#ifndef __ABSTRACT_MEMORY_HH__
-#define __ABSTRACT_MEMORY_HH__
+#ifndef __MEM_ABSTRACT_MEMORY_HH__
+#define __MEM_ABSTRACT_MEMORY_HH__
 
 #include "mem/mem_object.hh"
 #include "params/AbstractMemory.hh"
@@ -111,10 +111,13 @@ class AbstractMemory : public MemObject
     uint8_t* pmemAddr;
 
     // Enable specific memories to be reported to the configuration table
-    bool confTableReported;
+    const bool confTableReported;
 
     // Should the memory appear in the global address map
-    bool inAddrMap;
+    const bool inAddrMap;
+
+    // Should KVM map this memory for the guest
+    const bool kvmMap;
 
     std::list<LockedAddr> lockedAddrList;
 
@@ -282,6 +285,14 @@ class AbstractMemory : public MemObject
      */
     bool isInAddrMap() const { return inAddrMap; }
 
+    /**
+     * When shadow memories are in use, KVM may want to make one or the other,
+     * but cannot map both into the guest address space.
+     *
+     * @return if this memory should be mapped into the KVM guest address space
+     */
+    bool isKvmMap() const { return kvmMap; }
+
     /**
      * Perform an untimed memory access and update all the state
      * (e.g. locked addresses) and statistics accordingly. The packet
@@ -308,4 +319,4 @@ class AbstractMemory : public MemObject
 
 };
 
-#endif //__ABSTRACT_MEMORY_HH__
+#endif //__MEM_ABSTRACT_MEMORY_HH__