Commit 2ecbf44f authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'd1a6cb19'

* commit 'd1a6cb19':
  x86: Serialize rdtsc in read_time()
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 7e85727b d1a6cb19
......@@ -31,7 +31,12 @@
static inline uint64_t read_time(void)
{
uint32_t a, d;
__asm__ volatile("rdtsc" : "=a" (a), "=d" (d));
__asm__ volatile(
#if ARCH_X86_64 || defined(__SSE2__)
"lfence \n\t"
#endif
"rdtsc \n\t"
: "=a" (a), "=d" (d));
return ((uint64_t)d << 32) + a;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment