@@ -27,6 +27,7 @@ extern "C" {
#include <odp/hints.h>
#include <odp/debug.h>
#include <odp/byteorder.h>
+#include <odp/cpu.h>
#include <odp/cpumask.h>
#include <odp/barrier.h>
#include <odp/spinlock.h>
new file mode 100644
@@ -0,0 +1,54 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+
+/**
+ * @file
+ *
+ * ODP CPU API
+ */
+
+#ifndef ODP_CPU_H_
+#define ODP_CPU_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup odp_cpu ODP CPU
+ * @{
+ */
+
+
+/**
+ * CPU number
+ *
+ * CPU number where the thread is currently running. CPU numbering is system
+ * specific.
+ *
+ * @return CPU number
+ */
+int odp_cpu(void);
+
+/**
+ * CPU count
+ *
+ * Report the number of CPU's available to this ODP program.
+ * This may be smaller than the number of (online) CPU's in the system.
+ *
+ * @return Number of available CPU's
+ */
+int odp_cpu_count(void);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
@@ -18,6 +18,7 @@ odpinclude_HEADERS = \
$(top_srcdir)/platform/linux-generic/include/odp/classification.h \
$(top_srcdir)/platform/linux-generic/include/odp/compiler.h \
$(top_srcdir)/platform/linux-generic/include/odp/config.h \
+ $(top_srcdir)/platform/linux-generic/include/odp/cpu.h \
$(top_srcdir)/platform/linux-generic/include/odp/cpumask.h \
$(top_srcdir)/platform/linux-generic/include/odp/crypto.h \
$(top_srcdir)/platform/linux-generic/include/odp/debug.h \
@@ -69,6 +70,7 @@ odpapiinclude_HEADERS = \
$(top_srcdir)/include/odp/api/classification.h \
$(top_srcdir)/include/odp/api/compiler.h \
$(top_srcdir)/include/odp/api/config.h \
+ $(top_srcdir)/include/odp/api/cpu.h \
$(top_srcdir)/include/odp/api/cpumask.h \
$(top_srcdir)/include/odp/api/crypto.h \
$(top_srcdir)/include/odp/api/debug.h \
new file mode 100644
@@ -0,0 +1,26 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP CPU
+ */
+
+#ifndef ODP_PLAT_CPU_H_
+#define ODP_PLAT_CPU_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/api/cpu.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
This file contains cpu related API calls. The calls are renames from odp_thread_cpu() and odp_sys_cpu_count(). Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- include/odp.h | 1 + include/odp/api/cpu.h | 54 ++++++++++++++++++++++++++++++++ platform/linux-generic/Makefile.am | 2 ++ platform/linux-generic/include/odp/cpu.h | 26 +++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 include/odp/api/cpu.h create mode 100644 platform/linux-generic/include/odp/cpu.h