From ad46183e235fac44e534cdaf2d3b5f58d212b00d Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Fri, 11 May 2018 14:21:05 +0200 Subject: [PATCH] fix rdtsc usage One user had a problem compiling oaisim. This commit fixes it. The compilation log was saying: targets/RT/USER/lte-ue.c: In function UE_thread_rxn_txnp4: openair2/UTIL/LOG/log.h:370:3: error: inconsistent operand constraints in an asm __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); ^ --- openair2/UTIL/LOG/log.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index 00bc334de5..d0ac13dac3 100644 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -373,9 +373,9 @@ void *log_thread_function(void * list); /* @}*/ static __inline__ uint64_t rdtsc(void) { - uint64_t a, d; + uint32_t a, d; __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d)); - return (d<<32) | a; + return (((uint64_t)d)<<32) | ((uint64_t)a); } #define DEBUG_REALTIME 1 -- 2.26.2