changeset b636411c118e in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=b636411c118e
description:
        SE mode: Make the direction anonymous mmaps move through memory 
configurable.

diffstat:

2 files changed, 11 insertions(+), 2 deletions(-)
src/kern/operatingsystem.hh |    4 ++++
src/sim/syscall_emul.hh     |    9 +++++++--

diffs (34 lines):

diff -r 71b42be12ccd -r b636411c118e src/kern/operatingsystem.hh
--- a/src/kern/operatingsystem.hh       Thu Oct 01 09:35:06 2009 -0400
+++ b/src/kern/operatingsystem.hh       Fri Oct 02 01:32:00 2009 -0700
@@ -122,6 +122,10 @@
 
     static int openSpecialFile(std::string path, LiveProcess *process, 
ThreadContext *tc);
 
+    static const bool mmapGrowsUp = true;
+
+    static bool mmapGrowsDown() { return false; }
+
 };  // class OperatingSystem
 
 
diff -r 71b42be12ccd -r b636411c118e src/sim/syscall_emul.hh
--- a/src/sim/syscall_emul.hh   Thu Oct 01 09:35:06 2009 -0400
+++ b/src/sim/syscall_emul.hh   Fri Oct 02 01:32:00 2009 -0700
@@ -978,9 +978,14 @@
     }
 
     // pick next address from our "mmap region"
-    start = p->mmap_end;
+    if (OS::mmapGrowsDown()) {
+        start = p->mmap_end - length;
+        p->mmap_end = start;
+    } else {
+        start = p->mmap_end;
+        p->mmap_end += length;
+    }
     p->pTable->allocate(start, length);
-    p->mmap_end += length;
 
     if (!(flags & OS::TGT_MAP_ANONYMOUS)) {
         warn("allowing mmap of file @ fd %d. "
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to