summaryrefslogtreecommitdiff
path: root/src/sim/syscall_emul.hh
diff options
context:
space:
mode:
authorMichael LeBeane <Michael.Lebeane@amd.com>2016-02-13 12:33:07 -0500
committerMichael LeBeane <Michael.Lebeane@amd.com>2016-02-13 12:33:07 -0500
commit8d923c7380f1d5a1418c1d4b71cd4cfc63429448 (patch)
tree285c24352dcd930758c4b8eb5d05966213b4fff8 /src/sim/syscall_emul.hh
parentc6cede244b431c167ac0213d89ad2bd7a0abbd96 (diff)
downloadgem5-8d923c7380f1d5a1418c1d4b71cd4cfc63429448.tar.xz
syscall_emul: Implement clock_getres() system call
This patch implements the clock_getres() system call for arm and x86 in linux SE mode.
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 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 <class OS>
+SyscallReturn
+clock_getresFunc(SyscallDesc *desc, int num, LiveProcess *p, ThreadContext *tc)
+{
+ int index = 1;
+ TypedBufferArg<typename OS::timespec> 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 <class OS>
SyscallReturn