Commit 1115dde7194fc1c383e2b374697485ec20269cce
1 parent
57206fd4
x86-64 port (Jocelyn Mayer)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@752 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
13 additions
and
0 deletions
vl.c
... | ... | @@ -362,6 +362,19 @@ int64_t cpu_get_real_ticks(void) |
362 | 362 | return val; |
363 | 363 | } |
364 | 364 | |
365 | +#elif defined(__x86_64__) | |
366 | + | |
367 | +int64_t cpu_get_real_ticks(void) | |
368 | +{ | |
369 | + uint32_t low,high; | |
370 | + int64_t val; | |
371 | + asm volatile("rdtsc" : "=a" (low), "=d" (high)); | |
372 | + val = high; | |
373 | + val <<= 32; | |
374 | + val |= low; | |
375 | + return val; | |
376 | +} | |
377 | + | |
365 | 378 | #else |
366 | 379 | #error unsupported CPU |
367 | 380 | #endif | ... | ... |