summaryrefslogtreecommitdiff
path: root/src/sim/process.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2012-07-10 22:51:54 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2012-07-10 22:51:54 -0700
commit2e47aaabc0f5b3ab3d4507b023f0421fde9713c5 (patch)
treed215c81d06e89833ab929edbcf1e75c98e6bc8d1 /src/sim/process.hh
parent645fa9c2624bc497008f9fb18645e5184615048f (diff)
downloadgem5-2e47aaabc0f5b3ab3d4507b023f0421fde9713c5.tar.xz
Add hook to call map() on Process from python.
This enables configuration scripts to set up mappings from process virtual addresses to specific physical addresses in SE mode. This feature is needed to support modeling of user-accessible memories or devices in SE mode, avoiding the complexities of FS mode and the need to write a device driver.
Diffstat (limited to 'src/sim/process.hh')
-rw-r--r--src/sim/process.hh15
1 files changed, 15 insertions, 0 deletions
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);
};