diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-03 07:42:21 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-03 07:42:21 -0400 |
commit | e1ac9629398027186ef4c2a66772aeff2b4c6792 (patch) | |
tree | 69a2591a576690aeafca28eef2374b20b76d7c3c /src/sim/syscall_emul.cc | |
parent | 23c85407562c3e2e2f3e1ca8b8dcbdc38fac82df (diff) | |
download | gem5-e1ac9629398027186ef4c2a66772aeff2b4c6792.tar.xz |
arch: Cleanup unused ISA traits constants
This patch prunes unused values, and also unifies how the values are
defined (not using an enum for ALPHA), aligning the use of int vs Addr
etc.
The patch also removes the duplication of PageBytes/PageShift and
VMPageSize/LogVMPageSize. For all ISAs the two pairs had identical
values and the latter has been removed.
Diffstat (limited to 'src/sim/syscall_emul.cc')
-rw-r--r-- | src/sim/syscall_emul.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index fa18b910f..13ea784e5 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -148,7 +148,7 @@ exitGroupFunc(SyscallDesc *desc, int callnum, LiveProcess *process, SyscallReturn getpagesizeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) { - return (int)VMPageSize; + return (int)PageBytes; } @@ -167,9 +167,9 @@ brkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) if (new_brk > p->brk_point) { // might need to allocate some new pages for (ChunkGenerator gen(p->brk_point, new_brk - p->brk_point, - VMPageSize); !gen.done(); gen.next()) { + PageBytes); !gen.done(); gen.next()) { if (!p->pTable->translate(gen.addr())) - p->allocateMem(roundDown(gen.addr(), VMPageSize), VMPageSize); + p->allocateMem(roundDown(gen.addr(), PageBytes), PageBytes); // if the address is already there, zero it out else { @@ -177,14 +177,14 @@ brkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) SETranslatingPortProxy &tp = tc->getMemProxy(); // split non-page aligned accesses - Addr next_page = roundUp(gen.addr(), VMPageSize); + Addr next_page = roundUp(gen.addr(), PageBytes); uint32_t size_needed = next_page - gen.addr(); tp.memsetBlob(gen.addr(), zero, size_needed); - if (gen.addr() + VMPageSize > next_page && + if (gen.addr() + PageBytes > next_page && next_page < new_brk && p->pTable->translate(next_page)) { - size_needed = VMPageSize - size_needed; + size_needed = PageBytes - size_needed; tp.memsetBlob(next_page, zero, size_needed); } } |