aboutsummaryrefslogtreecommitdiff
path: root/include/qemu/timer.h
diff options
context:
space:
mode:
authorPranith Kumar <bobby.prani@gmail.com>2017-06-13 14:56:59 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-06-13 14:56:59 +0100
commitd1bb099f6308d594061119e3a46ae29059fdb549 (patch)
tree545986d40a92d72c85f0f6233e60f8ed5f65a431 /include/qemu/timer.h
parenta14f9b8292e5196018264a5bb2966168e8c577e9 (diff)
downloadqemu-d1bb099f6308d594061119e3a46ae29059fdb549.zip
qemu-d1bb099f6308d594061119e3a46ae29059fdb549.tar.gz
qemu-d1bb099f6308d594061119e3a46ae29059fdb549.tar.bz2
timer.h: Provide better monotonic time
Tested and confirmed that the stretch i386 debian qcow2 image on a raspberry pi 2 works. Fixes: LP#: 893208 <https://bugs.launchpad.net/qemu/+bug/893208/> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20170418191817.10430-1-bobby.prani@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu/timer.h')
-rw-r--r--include/qemu/timer.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 8a1eb74..1b518bc 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -1020,10 +1020,9 @@ static inline int64_t cpu_get_host_ticks(void)
/* The host CPU doesn't have an easily accessible cycle counter.
Just return a monotonically increasing value. This will be
totally wrong, but hopefully better than nothing. */
-static inline int64_t cpu_get_host_ticks (void)
+static inline int64_t cpu_get_host_ticks(void)
{
- static int64_t ticks = 0;
- return ticks++;
+ return get_clock();
}
#endif