@@ -97,6 +97,7 @@ noinst_HEADERS = \
${srcdir}/include/odp_classification_inlines.h \
${srcdir}/include/odp_classification_internal.h \
${srcdir}/include/odp_config_internal.h \
+ ${srcdir}/include/odp_cpu_internal.h \
${srcdir}/include/odp_crypto_internal.h \
${srcdir}/include/odp_debug_internal.h \
${srcdir}/include/odp_forward_typedefs_internal.h \
@@ -12,11 +12,12 @@
#include <odp/api/cpu.h>
#include <odp/api/hints.h>
#include <odp/api/system_info.h>
+#include <odp_cpu_internal.h>
#include <odp_debug_internal.h>
#define GIGA 1000000000
-uint64_t odp_cpu_cycles(void)
+uint64_t _odp_cpu_cycles(void)
{
struct timespec time;
uint64_t sec, ns, hz, cycles;
@@ -7,8 +7,9 @@
#include <odp/api/cpu.h>
#include <odp/api/hints.h>
#include <odp/api/system_info.h>
+#include <odp_cpu_internal.h>
-uint64_t odp_cpu_cycles(void)
+uint64_t _odp_cpu_cycles(void)
{
#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
#define CVMX_TMP_STR2(x) #x
@@ -12,11 +12,12 @@
#include <odp/api/cpu.h>
#include <odp/api/hints.h>
#include <odp/api/system_info.h>
+#include <odp_cpu_internal.h>
#include <odp_debug_internal.h>
#define GIGA 1000000000
-uint64_t odp_cpu_cycles(void)
+uint64_t _odp_cpu_cycles(void)
{
struct timespec time;
uint64_t sec, ns, hz, cycles;
@@ -4,8 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <odp/api/cpu.h>
+#include <odp_cpu_internal.h>
-uint64_t odp_cpu_cycles(void)
+uint64_t _odp_cpu_cycles(void)
{
union {
uint64_t tsc_64;
new file mode 100644
@@ -0,0 +1,22 @@
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_CPU_INTERNAL_H_
+#define ODP_CPU_INTERNAL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/cpu.h>
+
+uint64_t _odp_cpu_cycles(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
@@ -6,6 +6,12 @@
#include <odp/api/cpu.h>
#include <odp/api/hints.h>
+#include <odp_cpu_internal.h>
+
+uint64_t odp_cpu_cycles(void)
+{
+ return _odp_cpu_cycles();
+}
uint64_t odp_cpu_cycles_diff(uint64_t c2, uint64_t c1)
{
Lift the definition of odp_cpu_cycles() out of the arch specific directory into the common odp_cpu.c which then calls the internal arch specific definition. Signed-off-by: Brian Brooks <brian.brooks@linaro.org> --- platform/linux-generic/Makefile.am | 1 + platform/linux-generic/arch/default/odp_cpu_arch.c | 3 ++- platform/linux-generic/arch/mips64/odp_cpu_arch.c | 3 ++- platform/linux-generic/arch/powerpc/odp_cpu_arch.c | 3 ++- platform/linux-generic/arch/x86/odp_cpu_arch.c | 3 ++- platform/linux-generic/include/odp_cpu_internal.h | 22 ++++++++++++++++++++++ platform/linux-generic/odp_cpu.c | 6 ++++++ 7 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 platform/linux-generic/include/odp_cpu_internal.h -- 2.9.2