summaryrefslogtreecommitdiffstats
path: root/qemu-timer.h
authorRichard Henderson <[email protected]>2010-04-12 23:19:26 (GMT)
committer Aurelien Jarno <[email protected]>2010-04-27 03:50:42 (GMT)
commit14a6063a91083c9cbe1bc502ee58fc7ca146bc1a (patch) (side-by-side diff)
tree2b1173e2f8fa42081d736d893031f3c9a142b42f /qemu-timer.h
parent18f8e2c08bbd0dd8d32a3a536787076b8b958a4b (diff)
downloadqemu-kvm-14a6063a91083c9cbe1bc502ee58fc7ca146bc1a.zip
qemu-kvm-14a6063a91083c9cbe1bc502ee58fc7ca146bc1a.tar.gz
qemu-kvm-14a6063a91083c9cbe1bc502ee58fc7ca146bc1a.tar.bz2
Implement cpu_get_real_ticks for Alpha.
Signed-off-by: Richard Henderson <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
Diffstat (limited to 'qemu-timer.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qemu-timer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/qemu-timer.h b/qemu-timer.h
index 62da887..1494f79 100644
--- a/qemu-timer.h
+++ b/qemu-timer.h
@@ -209,6 +209,19 @@ static inline int64_t cpu_get_real_ticks(void)
return (int64_t)(count * cyc_per_count);
}
+#elif defined(__alpha__)
+
+static inline int64_t cpu_get_real_ticks(void)
+{
+ uint64_t cc;
+ uint32_t cur, ofs;
+
+ asm volatile("rpcc %0" : "=r"(cc));
+ cur = cc;
+ ofs = cc >> 32;
+ return cur - ofs;
+}
+
#else
/* The host CPU doesn't have an easily accessible cycle counter.
Just return a monotonically increasing value. This will be