aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-14 17:32:25 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-14 17:32:25 +0000
commitfdbb46910a2033bd748681346d4261725f5e184b (patch)
tree366d6f921fbca0bbfd6afa63078bd91716d1aff3 /vl.c
parent43057ab1272ba2b9b052b19a3453fb0f3b510149 (diff)
Solaris/SPARC host port (Ben Taylor)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1979 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 3d80ec82da..d1aad07532 100644
--- a/vl.c
+++ b/vl.c
@@ -563,6 +563,28 @@ int64_t cpu_get_real_ticks(void)
return val;
}
+#elif defined(__sparc__) && defined(HOST_SOLARIS)
+
+uint64_t cpu_get_real_ticks (void)
+{
+#if defined(_LP64)
+ uint64_t rval;
+ asm volatile("rd %%tick,%0" : "=r"(rval));
+ return rval;
+#else
+ union {
+ uint64_t i64;
+ struct {
+ uint32_t high;
+ uint32_t low;
+ } i32;
+ } rval;
+ asm volatile("rd %%tick,%1; srlx %1,32,%0"
+ : "=r"(rval.i32.high), "=r"(rval.i32.low));
+ return rval.i64;
+#endif
+}
+
#else
#error unsupported CPU
#endif