1
1

The use of cpuid destroys the content of %eax and %edx,

so they must be saved before.
Этот коммит содержится в:
George Bosilca 2014-11-24 17:40:53 -05:00
родитель 261684858f
Коммит fb44b03f67

Просмотреть файл

@ -44,9 +44,11 @@ opal_sys_timer_get_cycles(void)
* can afford a small inaccuracy.
*/
__asm__ __volatile__ ("rdtscp\n\t"
"mov %%edx, %0\n\t"
"mov %%eax, %1\n\t"
"cpuid\n\t"
: "=a" (a), "=d" (d)
:: "rbx", "rcx");
: "=r" (a), "=r" (d)
:: "rax", "rbx", "rcx", "rdx");
#endif
return ((opal_timer_t)a) | (((opal_timer_t)d) << 32);
}