added ARM aarch64 unlinkat syscall support, modeled on other <xxx>at syscalls.
This gets all of the cpu2006 int workloads passing in SE mode on aarch64.
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
/* 32 */ SyscallDesc("flock", unimplementedFunc),
/* 33 */ SyscallDesc("mknodat", unimplementedFunc),
/* 34 */ SyscallDesc("mkdirat", unimplementedFunc),
- /* 35 */ SyscallDesc("unlinkat", unimplementedFunc),
+ /* 35 */ SyscallDesc("unlinkat", unlinkatFunc<ArmLinux64>),
/* 36 */ SyscallDesc("symlinkat", unimplementedFunc),
/* 37 */ SyscallDesc("linkat", unimplementedFunc),
/* 38 */ SyscallDesc("renameat", unimplementedFunc),
SyscallReturn
unlinkFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+{
+ return unlinkHelper(desc, num, p, tc, 0);
+}
+
+SyscallReturn
+unlinkHelper(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 -EFAULT;
LiveProcess *p, ThreadContext *tc);
/// Target unlink() handler.
+SyscallReturn unlinkHelper(SyscallDesc *desc, int num,
+ LiveProcess *p, ThreadContext *tc,
+ int index);
SyscallReturn unlinkFunc(SyscallDesc *desc, int num,
LiveProcess *p, ThreadContext *tc);
return openFunc<OS>(desc, callnum, process, tc, 1);
}
+/// Target unlinkat() handler.
+template <class OS>
+SyscallReturn
+unlinkatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
+ ThreadContext *tc)
+{
+ int index = 0;
+ int dirfd = process->getSyscallArg(tc, index);
+ if (dirfd != OS::TGT_AT_FDCWD)
+ warn("unlinkat: first argument not AT_FDCWD; unlikely to work");
+
+ return unlinkHelper(desc, callnum, process, tc, 1);
+}
+
/// Target facessat() handler
template <class OS>
SyscallReturn