summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sim/Process.py8
-rw-r--r--src/sim/process.cc8
-rw-r--r--src/sim/process.hh15
3 files changed, 31 insertions, 0 deletions
diff --git a/src/sim/Process.py b/src/sim/Process.py
index 81108dd70..bb76b5cf7 100644
--- a/src/sim/Process.py
+++ b/src/sim/Process.py
@@ -39,6 +39,14 @@ class Process(SimObject):
system = Param.System(Parent.any, "system process will run on")
max_stack_size = Param.MemorySize('64MB', 'maximum size of the stack')
+ @classmethod
+ def export_method_cxx_predecls(cls, code):
+ code('#include "sim/process.hh"')
+
+ @classmethod
+ def export_methods(cls, code):
+ code('bool map(Addr vaddr, Addr paddr, int size);')
+
class LiveProcess(Process):
type = 'LiveProcess'
executable = Param.String('', "executable (overrides cmd[0] if set)")
diff --git a/src/sim/process.cc b/src/sim/process.cc
index 39b2d0777..72b808a1d 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -545,6 +545,14 @@ Process::unserialize(Checkpoint *cp, const std::string &section)
}
+bool
+Process::map(Addr vaddr, Addr paddr, int size)
+{
+ pTable->map(vaddr, paddr, size);
+ return true;
+}
+
+
////////////////////////////////////////////////////////////////////////
//
// LiveProcess member definitions
diff --git a/src/sim/process.hh b/src/sim/process.hh
index a5265f5b0..cddd060fd 100644
--- a/src/sim/process.hh
+++ b/src/sim/process.hh
@@ -210,6 +210,21 @@ class Process : public SimObject
/// @return Whether the fault has been fixed.
bool fixupStackFault(Addr vaddr);
+ /**
+ * Map a contiguous range of virtual addresses in this process's
+ * address space to a contiguous range of physical addresses.
+ * This function exists primarily to enable exposing the map
+ * operation to python, so that configuration scripts can set up
+ * mappings in SE mode.
+ *
+ * @param vaddr The starting virtual address of the range.
+ * @param paddr The starting physical address of the range.
+ * @param size The length of the range in bytes.
+ * @return True if the map operation was successful. (At this
+ * point in time, the map operation always succeeds.)
+ */
+ bool map(Addr vaddr, Addr paddr, int size);
+
void serialize(std::ostream &os);
void unserialize(Checkpoint *cp, const std::string &section);
};