aboutsummaryrefslogtreecommitdiff
path: root/linux-user/strace.c
diff options
context:
space:
mode:
authorAleksandar Markovic <aleksandar.markovic@imgtec.com>2016-10-10 13:23:29 +0200
committerRiku Voipio <riku.voipio@linaro.org>2016-10-21 15:20:09 +0300
commit38860a0343df894a1c3371597eb4d305078642fb (patch)
tree4c3beb6d708eb11d671e23a62fbc40f039311e24 /linux-user/strace.c
parent17351c3f11e52101e1498ba03eec06fa5e4e713a (diff)
downloadqemu-38860a0343df894a1c3371597eb4d305078642fb.zip
qemu-38860a0343df894a1c3371597eb4d305078642fb.tar.gz
qemu-38860a0343df894a1c3371597eb4d305078642fb.tar.bz2
linux-user: Add support for clock_adjtime() syscall
This patch implements Qemu user mode clock_adjtime() syscall support. The implementation is based on invocation of host's clock_adjtime(). Signed-off-by: Aleksandar Rikalo <aleksandar.rikalo@imgtec.com> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user/strace.c')
-rw-r--r--linux-user/strace.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/linux-user/strace.c b/linux-user/strace.c
index 679f840..489dbc9 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -435,6 +435,69 @@ print_fdset(int n, abi_ulong target_fds_addr)
}
#endif
+#ifdef TARGET_NR_clock_adjtime
+/* IDs of the various system clocks */
+#define TARGET_CLOCK_REALTIME 0
+#define TARGET_CLOCK_MONOTONIC 1
+#define TARGET_CLOCK_PROCESS_CPUTIME_ID 2
+#define TARGET_CLOCK_THREAD_CPUTIME_ID 3
+#define TARGET_CLOCK_MONOTONIC_RAW 4
+#define TARGET_CLOCK_REALTIME_COARSE 5
+#define TARGET_CLOCK_MONOTONIC_COARSE 6
+#define TARGET_CLOCK_BOOTTIME 7
+#define TARGET_CLOCK_REALTIME_ALARM 8
+#define TARGET_CLOCK_BOOTTIME_ALARM 9
+#define TARGET_CLOCK_SGI_CYCLE 10
+#define TARGET_CLOCK_TAI 11
+
+static void
+print_clockid(int clockid, int last)
+{
+ switch (clockid) {
+ case TARGET_CLOCK_REALTIME:
+ gemu_log("CLOCK_REALTIME");
+ break;
+ case TARGET_CLOCK_MONOTONIC:
+ gemu_log("CLOCK_MONOTONIC");
+ break;
+ case TARGET_CLOCK_PROCESS_CPUTIME_ID:
+ gemu_log("CLOCK_PROCESS_CPUTIME_ID");
+ break;
+ case TARGET_CLOCK_THREAD_CPUTIME_ID:
+ gemu_log("CLOCK_THREAD_CPUTIME_ID");
+ break;
+ case TARGET_CLOCK_MONOTONIC_RAW:
+ gemu_log("CLOCK_MONOTONIC_RAW");
+ break;
+ case TARGET_CLOCK_REALTIME_COARSE:
+ gemu_log("CLOCK_REALTIME_COARSE");
+ break;
+ case TARGET_CLOCK_MONOTONIC_COARSE:
+ gemu_log("CLOCK_MONOTONIC_COARSE");
+ break;
+ case TARGET_CLOCK_BOOTTIME:
+ gemu_log("CLOCK_BOOTTIME");
+ break;
+ case TARGET_CLOCK_REALTIME_ALARM:
+ gemu_log("CLOCK_REALTIME_ALARM");
+ break;
+ case TARGET_CLOCK_BOOTTIME_ALARM:
+ gemu_log("CLOCK_BOOTTIME_ALARM");
+ break;
+ case TARGET_CLOCK_SGI_CYCLE:
+ gemu_log("CLOCK_SGI_CYCLE");
+ break;
+ case TARGET_CLOCK_TAI:
+ gemu_log("CLOCK_TAI");
+ break;
+ default:
+ gemu_log("%d", clockid);
+ break;
+ }
+ gemu_log("%s", get_comma(last));
+}
+#endif
+
/*
* Sysycall specific output functions
*/
@@ -1096,6 +1159,19 @@ print_chmod(const struct syscallname *name,
}
#endif
+#ifdef TARGET_NR_clock_adjtime
+static void
+print_clock_adjtime(const struct syscallname *name,
+ abi_long arg0, abi_long arg1, abi_long arg2,
+ abi_long arg3, abi_long arg4, abi_long arg5)
+{
+ print_syscall_prologue(name);
+ print_clockid(arg0, 0);
+ print_pointer(arg1, 1);
+ print_syscall_epilogue(name);
+}
+#endif
+
#ifdef TARGET_NR_clone
static void do_print_clone(unsigned int flags, abi_ulong newsp,
abi_ulong parent_tidptr, target_ulong newtls,