summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.hh
diff options
context:
space:
mode:
authormike upton <michaelupton@gmail.com>2015-01-03 17:51:48 -0600
committermike upton <michaelupton@gmail.com>2015-01-03 17:51:48 -0600
commitcb911559dc04226edef89ff37636dbb17aad5604 (patch)
treef4fb606c95668d7f8cdbcc0ba9abcbcf4e035024 /src/sim/syscall_emul.hh
parent5a5416d575f68e416ebe713ad76dc468a59ac23c (diff)
downloadgem5-cb911559dc04226edef89ff37636dbb17aad5604.tar.xz
arm: Add unlinkat syscall implementation
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>
Diffstat (limited to 'src/sim/syscall_emul.hh')
-rw-r--r--src/sim/syscall_emul.hh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index 0c06a5147..cc430b949 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -195,6 +195,9 @@ SyscallReturn readlinkFunc(SyscallDesc *desc, int num,
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);
@@ -655,6 +658,20 @@ openatFunc(SyscallDesc *desc, int callnum, LiveProcess *process,
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