From 16bda9c03eb79e223f3cbc03ef80e75b7e27f266 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Fri, 23 Dec 2005 13:50:35 -0500 Subject: Fix roundUp function template so explicit arg is not needed in a few more cases. base/intmath.hh: align arg to roundUp should be int, not template class sim/process.cc: sim/syscall_emul.hh: No need for explicit template arg now that roundUp is fixed. --HG-- extra : convert_revision : f9f4639e022acb9f427e8d30d81c782504437c53 --- base/intmath.hh | 4 ++-- sim/process.cc | 2 +- sim/syscall_emul.hh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/intmath.hh b/base/intmath.hh index 3922a326b..c8b9c5ec5 100644 --- a/base/intmath.hh +++ b/base/intmath.hh @@ -194,9 +194,9 @@ divCeil(T a, T b) template inline T -roundUp(T val, T align) +roundUp(T val, int align) { - T mask = align - 1; + T mask = (T)align - 1; return (val + mask) & ~mask; } diff --git a/sim/process.cc b/sim/process.cc index 28bc5ac3b..395e2eb0a 100644 --- a/sim/process.cc +++ b/sim/process.cc @@ -274,7 +274,7 @@ LiveProcess::LiveProcess(const string &nm, ObjectFile *objFile, text_size = objFile->textSize(); data_base = objFile->dataBase(); data_size = objFile->dataSize() + objFile->bssSize(); - brk_point = roundUp(data_base + data_size, VMPageSize); + brk_point = roundUp(data_base + data_size, VMPageSize); // load object file into target memory objFile->loadSections(memory); diff --git a/sim/syscall_emul.hh b/sim/syscall_emul.hh index c535b5ad6..185ada2c5 100644 --- a/sim/syscall_emul.hh +++ b/sim/syscall_emul.hh @@ -634,7 +634,7 @@ mmapFunc(SyscallDesc *desc, int num, Process *p, ExecContext *xc) if (start == 0) { // user didn't give an address... pick one from our "mmap region" start = p->mmap_end; - p->mmap_end += roundUp(length, VMPageSize); + p->mmap_end += roundUp(length, VMPageSize); if (p->nxm_start != 0) { //If we have an nxm space, make sure we haven't colided assert(p->mmap_end < p->nxm_start); -- cgit v1.2.3