* 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"
Addr addr;
// locking hw context
- const int contextId;
+ const ContextID contextId;
static Addr mask(Addr paddr) { return (paddr & ~Addr_Mask); }
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;
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.
*/
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
/**
* Register Statistics
*/
- virtual void regStats();
+ void regStats() override;
};
-#endif //__ABSTRACT_MEMORY_HH__
+#endif //__MEM_ABSTRACT_MEMORY_HH__