summaryrefslogtreecommitdiff
path: root/src/sim/Process.py
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.py
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.py')
-rw-r--r--src/sim/Process.py8
1 files changed, 8 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)")