From: Richard Henderson Date: Mon, 12 Apr 2010 23:19:26 +0000 (-0700) Subject: Implement cpu_get_real_ticks for Alpha. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=14a6063a91083c9cbe1bc502ee58fc7ca146bc1a;p=qemu.git Implement cpu_get_real_ticks for Alpha. Signed-off-by: Richard Henderson Signed-off-by: Aurelien Jarno --- diff --git a/qemu-timer.h b/qemu-timer.h index 62da887584..1494f79406 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