On 02/03/2015 01:07 PM, Ola Liljedahl wrote:
On 3 February 2015 at 11:59, Petri Savolainen
<[email protected]> wrote:
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 <[email protected]>
---
  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

diff --git a/include/odp.h b/include/odp.h
index 30bed8e..99e01eb 100644
--- a/include/odp.h
+++ b/include/odp.h
@@ -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>
diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
new file mode 100644
index 0000000..16461a3
--- /dev/null
+++ b/include/odp/api/cpu.h
@@ -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);
Why not call thus function odp_cpu_num()? (or odp_cpu_number)?
"odp_cpu" is missing something and does not lead to direct
understanding of what the function does or returns.

I become odp_cpu_id() in the second patch.
Why not to name it like this in the first patch?

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to