fixed rdtsc on x86_64 (upper 32bits were missing)
This commit is contained in:
parent
cb26b6fe01
commit
9f7295672f
1 changed files with 6 additions and 0 deletions
|
@ -228,9 +228,15 @@ inline static uint32_t has_nx(void)
|
||||||
*/
|
*/
|
||||||
inline static uint64_t rdtsc(void)
|
inline static uint64_t rdtsc(void)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_X86_32
|
||||||
uint64_t x;
|
uint64_t x;
|
||||||
asm volatile ("rdtsc" : "=A" (x));
|
asm volatile ("rdtsc" : "=A" (x));
|
||||||
return 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
|
/** @brief Flush cache
|
||||||
|
|
Loading…
Add table
Reference in a new issue