mem: Remove unused size field from the CacheBlk class
[gem5.git] / src / mem / abstract_mem.hh
index d6d33c8ee7209e56cfe098df5d40381739410013..31d34f051bd1091e133c0bfb6b76b1748b0d3026 100644 (file)
@@ -74,7 +74,7 @@ class LockedAddr {
     Addr addr;
 
     // locking hw context
-    const int contextId;
+    const ContextID contextId;
 
     static Addr mask(Addr paddr) { return (paddr & ~Addr_Mask); }
 
@@ -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;
 
@@ -194,6 +197,11 @@ class AbstractMemory : public MemObject
     AbstractMemory(const Params* p);
     virtual ~AbstractMemory() {}
 
+    /**
+     * Initialise this memory.
+     */
+    void init() override;
+
     /**
      * See if this is a null memory that should never store data and
      * always return zero.
@@ -202,13 +210,6 @@ class AbstractMemory : public MemObject
      */
     bool isNull() const { return params()->null; }
 
-    /**
-     * See if this memory should be initialized to zero or not.
-     *
-     * @return true if zero
-     */
-    bool initToZero() const { return params()->zero; }
-
     /**
      * Set the host memory backing store to be used by this memory
      * controller.
@@ -266,7 +267,7 @@ class AbstractMemory : public MemObject
      *
      * @return the start address of the memory
      */
-    Addr start() const { return range.start; }
+    Addr start() const { return range.start(); }
 
     /**
      *  Should this memory be passed to the kernel and part of the OS
@@ -284,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
@@ -306,7 +315,7 @@ class AbstractMemory : public MemObject
     /**
      * Register Statistics
      */
-    virtual void regStats();
+    void regStats() override;
 
 };