summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorBrandon Potter <Brandon.Potter@amd.com>2017-03-01 13:18:49 -0600
committerBrandon Potter <Brandon.Potter@amd.com>2017-03-09 22:42:45 +0000
commite5fe2b82b7cf8842a5a202da69c003d2a2c6af3f (patch)
tree5fa8722df2f643bb5978108afc3638160218b01a /src/sim
parent43418e7f81099072fb7d56dae11110ae1d858162 (diff)
downloadgem5-e5fe2b82b7cf8842a5a202da69c003d2a2c6af3f.tar.xz
style: Correct some style issues
This changeset fixes line alignment issues, spacing, spelling, etc. for files that are used during SE Mode. Change-Id: Ie61b8d0eb4ebb5af554d72f1297808027833616e Reviewed-on: https://gem5-review.googlesource.com/2264 Maintainer: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Tony Gutierrez <anthony.gutierrez@amd.com> Reviewed-by: Michael LeBeane <Michael.Lebeane@amd.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Pierre-Yves PĂ©neau <pierre-yves.peneau@lirmm.fr>
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/process.cc2
-rw-r--r--src/sim/syscall_emul.cc32
-rw-r--r--src/sim/syscall_emul.hh51
3 files changed, 41 insertions, 44 deletions
diff --git a/src/sim/process.cc b/src/sim/process.cc
index e516e2a05..71f398893 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -340,7 +340,7 @@ Process::fixupStackFault(Addr vaddr)
fatal("Maximum stack size exceeded\n");
allocateMem(stack_min, TheISA::PageBytes);
inform("Increasing stack size by one page.");
- };
+ }
memState->setStackMin(stack_min);
return true;
}
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index f61de229c..2459c801f 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -177,8 +177,7 @@ brkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
tp.memsetBlob(gen.addr(), zero, size_needed);
if (gen.addr() + PageBytes > next_page &&
next_page < new_brk &&
- p->pTable->translate(next_page))
- {
+ p->pTable->translate(next_page)) {
size_needed = PageBytes - size_needed;
tp.memsetBlob(next_page, zero, size_needed);
}
@@ -218,7 +217,7 @@ readFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
int tgt_fd = p->getSyscallArg(tc, index);
- Addr bufPtr = p->getSyscallArg(tc, index);
+ Addr buf_ptr = p->getSyscallArg(tc, index);
int nbytes = p->getSyscallArg(tc, index);
auto hbfdp = std::dynamic_pointer_cast<HBFDEntry>((*p->fds)[tgt_fd]);
@@ -226,7 +225,7 @@ readFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
return -EBADF;
int sim_fd = hbfdp->getSimFD();
- BufferArg bufArg(bufPtr, nbytes);
+ BufferArg bufArg(buf_ptr, nbytes);
int bytes_read = read(sim_fd, bufArg.bufferPtr(), nbytes);
if (bytes_read > 0)
@@ -240,7 +239,7 @@ writeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
int tgt_fd = p->getSyscallArg(tc, index);
- Addr bufPtr = p->getSyscallArg(tc, index);
+ Addr buf_ptr = p->getSyscallArg(tc, index);
int nbytes = p->getSyscallArg(tc, index);
auto hbfdp = std::dynamic_pointer_cast<HBFDEntry>((*p->fds)[tgt_fd]);
@@ -248,7 +247,7 @@ writeFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
return -EBADF;
int sim_fd = hbfdp->getSimFD();
- BufferArg bufArg(bufPtr, nbytes);
+ BufferArg bufArg(buf_ptr, nbytes);
bufArg.copyIn(tc->getMemProxy());
int bytes_written = write(sim_fd, bufArg.bufferPtr(), nbytes);
@@ -324,9 +323,9 @@ SyscallReturn
gethostnameFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int index = 0;
- Addr bufPtr = p->getSyscallArg(tc, index);
+ Addr buf_ptr = p->getSyscallArg(tc, index);
int name_len = p->getSyscallArg(tc, index);
- BufferArg name(bufPtr, name_len);
+ BufferArg name(buf_ptr, name_len);
strncpy((char *)name.bufferPtr(), hostname, name_len);
@@ -340,9 +339,9 @@ getcwdFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
{
int result = 0;
int index = 0;
- Addr bufPtr = p->getSyscallArg(tc, index);
+ Addr buf_ptr = p->getSyscallArg(tc, index);
unsigned long size = p->getSyscallArg(tc, index);
- BufferArg buf(bufPtr, size);
+ BufferArg buf(buf_ptr, size);
// Is current working directory defined?
string cwd = p->getcwd();
@@ -386,10 +385,10 @@ readlinkFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc,
// Adjust path for current working directory
path = p->fullPath(path);
- Addr bufPtr = p->getSyscallArg(tc, index);
+ Addr buf_ptr = p->getSyscallArg(tc, index);
size_t bufsiz = p->getSyscallArg(tc, index);
- BufferArg buf(bufPtr, bufsiz);
+ BufferArg buf(buf_ptr, bufsiz);
int result = -1;
if (path != "/proc/self/exe") {
@@ -539,7 +538,7 @@ truncate64Func(SyscallDesc *desc, int num,
string path;
if (!tc->getMemProxy().tryReadString(path, process->getSyscallArg(tc, index)))
- return -EFAULT;
+ return -EFAULT;
int64_t length = process->getSyscallArg(tc, index, 64);
@@ -729,7 +728,6 @@ fcntl64Func(SyscallDesc *desc, int num, Process *p, ThreadContext *tc)
// to the underlying OS
warn("fcntl64(%d, %d) passed through to host\n", tgt_fd, cmd);
return fcntl(sim_fd, cmd);
- // return 0;
}
}
@@ -823,8 +821,8 @@ getuidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
// simulation to be deterministic.
// EUID goes in r20.
- tc->setIntReg(SyscallPseudoReturnReg, process->euid()); //EUID
- return process->uid(); // UID
+ tc->setIntReg(SyscallPseudoReturnReg, process->euid()); // EUID
+ return process->uid(); // UID
}
@@ -833,7 +831,7 @@ getgidPseudoFunc(SyscallDesc *desc, int callnum, Process *process,
ThreadContext *tc)
{
// Get current group ID. EGID goes in r20.
- tc->setIntReg(SyscallPseudoReturnReg, process->egid()); //EGID
+ tc->setIntReg(SyscallPseudoReturnReg, process->egid()); // EGID
return process->gid();
}
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 8cca6ebcb..099ff58d9 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -285,8 +285,8 @@ SyscallReturn accessFunc(SyscallDesc *desc, int num,
int index);
/// Futex system call
-/// Implemented by Daniel Sanchez
-/// Used by printf's in multi-threaded apps
+/// Implemented by Daniel Sanchez
+/// Used by printf's in multi-threaded apps
template <class OS>
SyscallReturn
futexFunc(SyscallDesc *desc, int callnum, Process *process,
@@ -477,7 +477,7 @@ convertStatBuf(target_stat &tgt, host_stat *host, bool fakeTTY = false)
tgt->st_mtimeX = TheISA::htog(tgt->st_mtimeX);
tgt->st_ctimeX = host->st_ctime;
tgt->st_ctimeX = TheISA::htog(tgt->st_ctimeX);
- // Force the block size to be 8k. This helps to ensure buffered io works
+ // Force the block size to be 8KB. This helps to ensure buffered io works
// consistently across different hosts.
tgt->st_blksize = 0x2000;
tgt->st_blksize = TheISA::htog(tgt->st_blksize);
@@ -508,11 +508,11 @@ convertStat64Buf(target_stat &tgt, host_stat64 *host, bool fakeTTY = false)
#endif
}
-//Here are a couple convenience functions
+// Here are a couple of convenience functions
template<class OS>
static void
copyOutStatBuf(SETranslatingPortProxy &mem, Addr addr,
- hst_stat *host, bool fakeTTY = false)
+ hst_stat *host, bool fakeTTY = false)
{
typedef TypedBufferArg<typename OS::tgt_stat> tgt_stat_buf;
tgt_stat_buf tgt(addr);
@@ -523,7 +523,7 @@ copyOutStatBuf(SETranslatingPortProxy &mem, Addr addr,
template<class OS>
static void
copyOutStat64Buf(SETranslatingPortProxy &mem, Addr addr,
- hst_stat64 *host, bool fakeTTY = false)
+ hst_stat64 *host, bool fakeTTY = false)
{
typedef TypedBufferArg<typename OS::tgt_stat64> tgt_stat_buf;
tgt_stat_buf tgt(addr);
@@ -1604,24 +1604,24 @@ getrlimitFunc(SyscallDesc *desc, int callnum, Process *process,
TypedBufferArg<typename OS::rlimit> rlp(process->getSyscallArg(tc, index));
switch (resource) {
- case OS::TGT_RLIMIT_STACK:
- // max stack size in bytes: make up a number (8MB for now)
- rlp->rlim_cur = rlp->rlim_max = 8 * 1024 * 1024;
- rlp->rlim_cur = TheISA::htog(rlp->rlim_cur);
- rlp->rlim_max = TheISA::htog(rlp->rlim_max);
- break;
-
- case OS::TGT_RLIMIT_DATA:
- // max data segment size in bytes: make up a number
- rlp->rlim_cur = rlp->rlim_max = 256 * 1024 * 1024;
- rlp->rlim_cur = TheISA::htog(rlp->rlim_cur);
- rlp->rlim_max = TheISA::htog(rlp->rlim_max);
- break;
-
- default:
- warn("getrlimit: unimplemented resource %d", resource);
- return -EINVAL;
- break;
+ case OS::TGT_RLIMIT_STACK:
+ // max stack size in bytes: make up a number (8MB for now)
+ rlp->rlim_cur = rlp->rlim_max = 8 * 1024 * 1024;
+ rlp->rlim_cur = TheISA::htog(rlp->rlim_cur);
+ rlp->rlim_max = TheISA::htog(rlp->rlim_max);
+ break;
+
+ case OS::TGT_RLIMIT_DATA:
+ // max data segment size in bytes: make up a number
+ rlp->rlim_cur = rlp->rlim_max = 256 * 1024 * 1024;
+ rlp->rlim_cur = TheISA::htog(rlp->rlim_cur);
+ rlp->rlim_max = TheISA::htog(rlp->rlim_max);
+ break;
+
+ default:
+ warn("getrlimit: unimplemented resource %d", resource);
+ return -EINVAL;
+ break;
}
rlp.copyOut(tc->getMemProxy());
@@ -1703,8 +1703,7 @@ utimesFunc(SyscallDesc *desc, int callnum, Process *process,
tp.copyIn(tc->getMemProxy());
struct timeval hostTimeval[2];
- for (int i = 0; i < 2; ++i)
- {
+ for (int i = 0; i < 2; ++i) {
hostTimeval[i].tv_sec = TheISA::gtoh((*tp)[i].tv_sec);
hostTimeval[i].tv_usec = TheISA::gtoh((*tp)[i].tv_usec);
}