From cde69c8e6a5b8245f67ffbe642a6e5253168304e Mon Sep 17 00:00:00 2001
From: Raymond Knopp <raymond.knopp@eurecom.fr>
Date: Mon, 13 Apr 2015 22:45:23 +0000
Subject: [PATCH] rtdsc_oai update for arm

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7144 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 openair1/PHY/TOOLS/time_meas.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h
index 9f96bbb30..b5bfb7fc0 100644
--- a/openair1/PHY/TOOLS/time_meas.h
+++ b/openair1/PHY/TOOLS/time_meas.h
@@ -66,6 +66,15 @@ static inline unsigned long long rdtsc_oai(void)
   __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
   return (d<<32) | a;
 }
+
+#elif defined(__arm__)
+static inline unsigned long long rdtsc_oai(void) __attribute__((always_inline));
+static inline unsigned long long rdtsc_oai(void)
+{
+        uint32_t r = 0;
+        asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(r) );
+        return (unsigned long long)r;
+}
 #endif
 
 static inline void start_meas(time_stats_t *ts)
-- 
GitLab