diff mbox

[v3,05/12] linux-generic: lift odp_cpu_cycles_max/resolution()

Message ID 20160726025625.7343-6-brian.brooks@linaro.org
State Superseded
Headers show

Commit Message

Brian Brooks July 26, 2016, 2:56 a.m. UTC
Define odp_cpu_cycles_max() and odp_cpu_cycles_resolution()
in the include API directory. These do not point to an internal
value in arch because they are common across all archs.

Signed-off-by: Brian Brooks <brian.brooks@linaro.org>

---
 platform/linux-generic/arch/default/odp_cpu_arch.c | 10 ----------
 platform/linux-generic/arch/mips64/odp_cpu_arch.c  | 10 ----------
 platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 10 ----------
 platform/linux-generic/arch/x86/odp_cpu_arch.c     | 10 ----------
 platform/linux-generic/include/odp/api/cpu.h       | 11 +++++++++++
 5 files changed, 11 insertions(+), 40 deletions(-)

-- 
2.9.0
diff mbox

Patch

diff --git a/platform/linux-generic/arch/default/odp_cpu_arch.c b/platform/linux-generic/arch/default/odp_cpu_arch.c
index 2ac223e..109dd93 100644
--- a/platform/linux-generic/arch/default/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/default/odp_cpu_arch.c
@@ -36,13 +36,3 @@  uint64_t odp_cpu_cycles(void)
 
 	return cycles;
 }
-
-uint64_t odp_cpu_cycles_max(void)
-{
-	return UINT64_MAX;
-}
-
-uint64_t odp_cpu_cycles_resolution(void)
-{
-	return 1;
-}
diff --git a/platform/linux-generic/arch/mips64/odp_cpu_arch.c b/platform/linux-generic/arch/mips64/odp_cpu_arch.c
index 646acf9..6dc8f86 100644
--- a/platform/linux-generic/arch/mips64/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/mips64/odp_cpu_arch.c
@@ -19,13 +19,3 @@  uint64_t odp_cpu_cycles(void)
 
 	return cycle;
 }
-
-uint64_t odp_cpu_cycles_max(void)
-{
-	return UINT64_MAX;
-}
-
-uint64_t odp_cpu_cycles_resolution(void)
-{
-	return 1;
-}
diff --git a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
index 2ac223e..109dd93 100644
--- a/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/powerpc/odp_cpu_arch.c
@@ -36,13 +36,3 @@  uint64_t odp_cpu_cycles(void)
 
 	return cycles;
 }
-
-uint64_t odp_cpu_cycles_max(void)
-{
-	return UINT64_MAX;
-}
-
-uint64_t odp_cpu_cycles_resolution(void)
-{
-	return 1;
-}
diff --git a/platform/linux-generic/arch/x86/odp_cpu_arch.c b/platform/linux-generic/arch/x86/odp_cpu_arch.c
index c8cf27b..c3be356 100644
--- a/platform/linux-generic/arch/x86/odp_cpu_arch.c
+++ b/platform/linux-generic/arch/x86/odp_cpu_arch.c
@@ -21,13 +21,3 @@  uint64_t odp_cpu_cycles(void)
 
 	return tsc.tsc_64;
 }
-
-uint64_t odp_cpu_cycles_max(void)
-{
-	return UINT64_MAX;
-}
-
-uint64_t odp_cpu_cycles_resolution(void)
-{
-	return 1;
-}
diff --git a/platform/linux-generic/include/odp/api/cpu.h b/platform/linux-generic/include/odp/api/cpu.h
index 4585d35..8dd978e 100644
--- a/platform/linux-generic/include/odp/api/cpu.h
+++ b/platform/linux-generic/include/odp/api/cpu.h
@@ -18,6 +18,17 @@  extern "C" {
 #endif
 
 #include "cpu_arch.h"
+#include <odp/api/std_types.h>
+
+static inline uint64_t odp_cpu_cycles_max(void)
+{
+	return UINT64_MAX;
+}
+
+static inline uint64_t odp_cpu_cycles_resolution(void)
+{
+	return 1;
+}
 
 static inline void odp_cpu_pause(void)
 {