summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-10-02 01:32:00 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-10-02 01:32:00 -0700
commit86f3bec76d1bd14ed11188877dd3039d0bcfd489 (patch)
tree34f202e1c8637febb456ed2fe8a0899849f0b050 /src/sim
parentf09f84da6ef01870991345539edae46b401cf311 (diff)
downloadgem5-86f3bec76d1bd14ed11188877dd3039d0bcfd489.tar.xz
SE mode: Make the direction anonymous mmaps move through memory configurable.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/syscall_emul.hh9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index c9ce4b14f..e45a6c797 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -978,9 +978,14 @@ mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
}
// 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. "