From c4a2f76fea6f9361363afd901c40290abf3344d9 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 17 Apr 2014 16:55:05 -0500 Subject: sim, arm: implement more of the at variety syscalls Needed for new AArch64 binaries --- src/sim/syscall_emul.hh | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/sim/syscall_emul.hh') diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index ac01ba1e8..e971902cb 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -253,7 +253,10 @@ SyscallReturn gethostnameFunc(SyscallDesc *desc, int num, SyscallReturn getcwdFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc); -/// Target unlink() handler. +/// Target readlink() handler. +SyscallReturn readlinkFunc(SyscallDesc *desc, int num, + LiveProcess *p, ThreadContext *tc, + int index = 0); SyscallReturn readlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc); @@ -350,6 +353,9 @@ SyscallReturn cloneFunc(SyscallDesc *desc, int num, /// Target access() handler SyscallReturn accessFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc); +SyscallReturn accessFunc(SyscallDesc *desc, int num, + LiveProcess *p, ThreadContext *tc, + int index); /// Futex system call /// Implemented by Daniel Sanchez @@ -696,6 +702,32 @@ openatFunc(SyscallDesc *desc, int callnum, LiveProcess *process, return openFunc(desc, callnum, process, tc, 1); } +/// Target facessat() handler +template +SyscallReturn +faccessatFunc(SyscallDesc *desc, int callnum, LiveProcess *process, + ThreadContext *tc) +{ + int index = 0; + int dirfd = process->getSyscallArg(tc, index); + if (dirfd != OS::TGT_AT_FDCWD) + warn("faccessat: first argument not AT_FDCWD; unlikely to work"); + return accessFunc(desc, callnum, process, tc, 1); +} + +/// Target readlinkat() handler +template +SyscallReturn +readlinkatFunc(SyscallDesc *desc, int callnum, LiveProcess *process, + ThreadContext *tc) +{ + int index = 0; + int dirfd = process->getSyscallArg(tc, index); + if (dirfd != OS::TGT_AT_FDCWD) + warn("openat: first argument not AT_FDCWD; unlikely to work"); + return readlinkFunc(desc, callnum, process, tc, 1); +} + /// Target sysinfo() handler. template SyscallReturn -- cgit v1.2.3