fixed rdtsc on x86_64 (upper 32bits were missing)

This commit is contained in:
Steffen Vogel 2014-04-23 18:36:23 +02:00
parent cb26b6fe01
commit 9f7295672f

View file

@ -228,9 +228,15 @@ inline static uint32_t has_nx(void)
*/
inline static uint64_t rdtsc(void)
{
#ifdef CONFIG_X86_32
uint64_t x;
asm volatile ("rdtsc" : "=A" (x));
return x;
#elif defined(CONFIG_X86_64)
uint64_t lo, hi;
asm volatile ("rdtsc" : "=a"(lo), "=d"(hi) );
return (hi << 32 | lo);
#endif
}
/** @brief Flush cache