From 9f7295672fd1b66f1ee39dbf8e797ce78b6ee2ab Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 23 Apr 2014 18:36:23 +0200 Subject: [PATCH] fixed rdtsc on x86_64 (upper 32bits were missing) --- arch/x86/include/asm/processor.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 56d9461b..817aef44 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -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