From 8d923c7380f1d5a1418c1d4b71cd4cfc63429448 Mon Sep 17 00:00:00 2001 From: Michael LeBeane Date: Sat, 13 Feb 2016 12:33:07 -0500 Subject: syscall_emul: Implement clock_getres() system call This patch implements the clock_getres() system call for arm and x86 in linux SE mode. --- src/sim/syscall_emul.hh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/sim') diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index ee305fbe9..bff7b79a4 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1357,6 +1357,23 @@ clock_gettimeFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) return 0; } +/// Target clock_getres() function. +template +SyscallReturn +clock_getresFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc) +{ + int index = 1; + TypedBufferArg tp(p->getSyscallArg(tc, index)); + + // Set resolution at ns, which is what clock_gettime() returns + tp->tv_sec = 0; + tp->tv_nsec = 1; + + tp.copyOut(tc->getMemProxy()); + + return 0; +} + /// Target gettimeofday() handler. template SyscallReturn -- cgit v1.2.3