summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.cc
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2014-04-17 16:55:05 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2014-04-17 16:55:05 -0500
commitc4a2f76fea6f9361363afd901c40290abf3344d9 (patch)
treefe4c8e6d63d351683397418f9f8c4eecf4d0bac9 /src/sim/syscall_emul.cc
parentf5c3f60601c8877196f11f8fc7f79d57e9775426 (diff)
downloadgem5-c4a2f76fea6f9361363afd901c40290abf3344d9.tar.xz
sim, arm: implement more of the at variety syscalls
Needed for new AArch64 binaries
Diffstat (limited to 'src/sim/syscall_emul.cc')
-rw-r--r--src/sim/syscall_emul.cc23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index a86065317..935193e7f 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -351,13 +351,20 @@ getcwdFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
return (result == -1) ? -errno : result;
}
+/// Target open() handler.
+SyscallReturn
+readlinkFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+ ThreadContext *tc)
+{
+ return readlinkFunc(desc, callnum, process, tc, 0);
+}
SyscallReturn
-readlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+readlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc,
+ int index)
{
string path;
- int index = 0;
if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index)))
return (TheISA::IntReg)-EFAULT;
@@ -852,10 +859,9 @@ cloneFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
}
SyscallReturn
-accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc)
+accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc,
+ int index)
{
- int index = 0;
-
string path;
if (!tc->getMemProxy().tryReadString(path, p->getSyscallArg(tc, index)))
return (TheISA::IntReg)-EFAULT;
@@ -868,3 +874,10 @@ accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc)
int result = access(path.c_str(), mode);
return (result == -1) ? -errno : result;
}
+
+SyscallReturn
+accessFunc(SyscallDesc *desc, int callnum, LiveProcess *p, ThreadContext *tc)
+{
+ return accessFunc(desc, callnum, p, tc, 0);
+}
+