mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 11:23:43 +08:00
x86-64 port (Jocelyn Mayer)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@752 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
57206fd42a
commit
1115dde719
13
vl.c
13
vl.c
@ -362,6 +362,19 @@ int64_t cpu_get_real_ticks(void)
|
||||
return val;
|
||||
}
|
||||
|
||||
#elif defined(__x86_64__)
|
||||
|
||||
int64_t cpu_get_real_ticks(void)
|
||||
{
|
||||
uint32_t low,high;
|
||||
int64_t val;
|
||||
asm volatile("rdtsc" : "=a" (low), "=d" (high));
|
||||
val = high;
|
||||
val <<= 32;
|
||||
val |= low;
|
||||
return val;
|
||||
}
|
||||
|
||||
#else
|
||||
#error unsupported CPU
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user