summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2011-10-22 22:30:08 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2011-10-22 22:30:08 -0700
commit6f9d294e8685f49d91af48065736ac1d67e53718 (patch)
tree1481f450d43324b79da17c80f27bdb1946b7c232 /src/sim/syscall_emul.hh
parent4d5f2c28a88f83d390e80407f55a8a02ead33878 (diff)
downloadgem5-6f9d294e8685f49d91af48065736ac1d67e53718.tar.xz
SE: move page allocation from PageTable to Process
PageTable supported an allocate() call that called back through the Process to allocate memory, but did not have a method to map addresses without allocating new pages. It makes more sense for Process to do the allocation, so this method was renamed allocateMem() and moved to Process, and uses a new map() call on PageTable. The remaining uses of the process pointer in PageTable were only to get the name and the PID, so by passing these in directly in the constructor, we can make PageTable completely independent of Process.
Diffstat (limited to 'src/sim/syscall_emul.hh')
-rw-r--r--src/sim/syscall_emul.hh10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 9bcf58844..50bf1a52f 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -677,7 +677,7 @@ mremapFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *
if (new_length > old_length) {
if ((start + old_length) == process->mmap_end) {
uint64_t diff = new_length - old_length;
- process->pTable->allocate(process->mmap_end, diff);
+ process->allocateMem(process->mmap_end, diff);
process->mmap_end += diff;
return start;
} else {
@@ -691,15 +691,15 @@ mremapFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *
process->mmap_end, process->mmap_end + new_length, new_length);
start = process->mmap_end;
// add on the remaining unallocated pages
- process->pTable->allocate(start + old_length, new_length - old_length);
+ process->allocateMem(start + old_length,
+ new_length - old_length);
process->mmap_end += new_length;
warn("returning %08p as start\n", start);
return start;
}
}
} else {
- process->pTable->deallocate(start + new_length, old_length -
- new_length);
+ process->pTable->unmap(start + new_length, old_length - new_length);
return start;
}
}
@@ -1065,7 +1065,7 @@ mmapFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
}
}
- p->pTable->allocate(start, length, clobber);
+ p->allocateMem(start, length, clobber);
return start;
}