diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-14 17:32:25 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-06-14 17:32:25 +0000 |
commit | fdbb46910a2033bd748681346d4261725f5e184b (patch) | |
tree | 366d6f921fbca0bbfd6afa63078bd91716d1aff3 /vl.c | |
parent | 43057ab1272ba2b9b052b19a3453fb0f3b510149 (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.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 |