Don't clobber PIC register on x86.

ck_pring
Devon H. O'Dell 11 years ago
parent 61ec6367d0
commit b4e865f201

@ -378,17 +378,19 @@ rdtsc(void)
return (((uint64_t)edx << 32) | eax);
#else
__asm__ __volatile__("cpuid;"
__asm__ __volatile__("pushl %%ebx;"
"cpuid;"
"rdtsc;"
: "+a" (eax), "=d" (edx)
:
: "%ecx", "%ebx", "memory");
: "%ecx", "memory");
__asm__ __volatile__("xorl %%eax, %%eax;"
"cpuid;"
"popl %%ebx;"
:
:
: "%eax", "%ebx", "%ecx", "%edx", "memory");
: "%eax", "%ecx", "%edx", "memory");
return (((uint64_t)edx << 32) | eax);
#endif /* !CK_MD_RDTSCP */

Loading…
Cancel
Save