summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mem/abstract_mem.cc10
-rw-r--r--src/mem/abstract_mem.hh4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc
index 581fc14cc..f0d626940 100644
--- a/src/mem/abstract_mem.cc
+++ b/src/mem/abstract_mem.cc
@@ -58,6 +58,9 @@ using namespace std;
AbstractMemory::AbstractMemory(const Params *p) :
MemObject(p), range(params()->range), pmemAddr(NULL),
+ backdoor(params()->range, nullptr,
+ (MemBackdoor::Flags)(MemBackdoor::Readable |
+ MemBackdoor::Writeable)),
confTableReported(p->conf_table_reported), inAddrMap(p->in_addr_map),
kvmMap(p->kvm_map), _system(NULL)
{
@@ -75,6 +78,13 @@ AbstractMemory::init()
void
AbstractMemory::setBackingStore(uint8_t* pmem_addr)
{
+ // If there was an existing backdoor, let everybody know it's going away.
+ if (backdoor.ptr())
+ backdoor.invalidate();
+
+ // The back door can't handle interleaved memory.
+ backdoor.ptr(range.interleaved() ? nullptr : pmem_addr);
+
pmemAddr = pmem_addr;
}
diff --git a/src/mem/abstract_mem.hh b/src/mem/abstract_mem.hh
index 4dd255f5f..cf9ca7439 100644
--- a/src/mem/abstract_mem.hh
+++ b/src/mem/abstract_mem.hh
@@ -49,6 +49,7 @@
#ifndef __MEM_ABSTRACT_MEMORY_HH__
#define __MEM_ABSTRACT_MEMORY_HH__
+#include "mem/backdoor.hh"
#include "mem/mem_object.hh"
#include "params/AbstractMemory.hh"
#include "sim/stats.hh"
@@ -110,6 +111,9 @@ class AbstractMemory : public MemObject
// Pointer to host memory used to implement this memory
uint8_t* pmemAddr;
+ // Backdoor to access this memory.
+ MemBackdoor backdoor;
+
// Enable specific memories to be reported to the configuration table
const bool confTableReported;