Implement cpu_get_real_ticks for Alpha.
authorRichard Henderson <rth@twiddle.net>
Mon, 12 Apr 2010 23:19:26 +0000 (16:19 -0700)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 27 Apr 2010 03:50:42 +0000 (05:50 +0200)
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
qemu-timer.h

index 62da887584a7b56eb80e0cd7072553cdee5cf5a8..1494f7940612fb97c85a886b939686931b446e86 100644 (file)
@@ -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