qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pranith Kumar <bobby.prani@gmail.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Cao jin" <caoj.fnst@cn.fujitsu.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Edgar E. Iglesias" <edgar.iglesias@xilinx.com>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] timer.h: Provide better monotonic time
Date: Tue, 18 Apr 2017 15:18:16 -0400	[thread overview]
Message-ID: <20170418191817.10430-1-bobby.prani@gmail.com> (raw)

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>
---
 include/qemu/timer.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 8a1eb74839..1b518bca30 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
 
-- 
2.11.0

             reply	other threads:[~2017-04-18 19:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 19:18 Pranith Kumar [this message]
2017-06-02 12:24 ` [Qemu-devel] [PATCH] timer.h: Provide better monotonic time Peter Maydell
2017-06-05  9:27   ` Paolo Bonzini
2017-06-07 14:30     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170418191817.10430-1-bobby.prani@gmail.com \
    --to=bobby.prani@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).