aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@linaro.org>2018-01-26 16:57:56 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-01-29 22:54:30 +0300
commitfdae7a0f9b597289579463c5464877c307d9c318 (patch)
treee94d18efca7d322379a42d62ea0e3aa702345c48 /include
parente98c15a9d2ee9d1dd21e3d6c3d9829581d8328c0 (diff)
linux-gen: thread: inline thread and cpu id
Inline thread and cpu id functions as application may use those often. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am1
-rw-r--r--include/odp/api/cpu.h2
-rw-r--r--include/odp/api/spec/thread.h28
-rw-r--r--include/odp/api/spec/thread_types.h59
-rw-r--r--include/odp/api/thread.h2
5 files changed, 64 insertions, 28 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index c3452ef33..aa330b8d4 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -96,6 +96,7 @@ odpapispecinclude_HEADERS = \
odp/api/spec/sync.h \
odp/api/spec/system_info.h \
odp/api/spec/thread.h \
+ odp/api/spec/thread_types.h \
odp/api/spec/threshold.h \
odp/api/spec/thrmask.h \
odp/api/spec/ticketlock.h \
diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
index 7229857a5..41c21b8a6 100644
--- a/include/odp/api/cpu.h
+++ b/include/odp/api/cpu.h
@@ -19,6 +19,8 @@ extern "C" {
#include <odp/api/abi/cpu.h>
+/* Thread inline file implements cpu API function */
+#include <odp/api/thread.h>
#include <odp/api/spec/cpu.h>
#ifdef __cplusplus
diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h
index 5fe74c69d..125e7a117 100644
--- a/include/odp/api/spec/thread.h
+++ b/include/odp/api/spec/thread.h
@@ -31,34 +31,6 @@ extern "C" {
*/
/**
- * Thread type
- */
-typedef enum odp_thread_type_e {
- /**
- * Worker thread
- *
- * Worker threads do most part of ODP application packet processing.
- * These threads provide high packet and data rates, with low and
- * predictable latency. Typically, worker threads are pinned to isolated
- * CPUs and packets are processed in a run-to-completion loop with very
- * low interference from the operating system.
- */
- ODP_THREAD_WORKER = 0,
-
- /**
- * Control thread
- *
- * Control threads do not participate the main packet flow through the
- * system, but e.g. control or monitor the worker threads, or handle
- * exceptions. These threads may perform general purpose processing,
- * use system calls, share the CPU with other threads and be interrupt
- * driven.
- */
- ODP_THREAD_CONTROL
-} odp_thread_type_t;
-
-
-/**
* Get thread identifier
*
* Returns the thread identifier of the current thread. Thread ids range from 0
diff --git a/include/odp/api/spec/thread_types.h b/include/odp/api/spec/thread_types.h
new file mode 100644
index 000000000..a5ddb78ea
--- /dev/null
+++ b/include/odp/api/spec/thread_types.h
@@ -0,0 +1,59 @@
+/* Copyright (c) 2018, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP thread API types
+ */
+
+#ifndef ODP_API_SPEC_THREAD_TYPES_H_
+#define ODP_API_SPEC_THREAD_TYPES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup odp_thread ODP THREAD
+ * @{
+ */
+
+/**
+ * Thread type
+ */
+typedef enum odp_thread_type_e {
+ /**
+ * Worker thread
+ *
+ * Worker threads do most part of ODP application packet processing.
+ * These threads provide high packet and data rates, with low and
+ * predictable latency. Typically, worker threads are pinned to isolated
+ * CPUs and packets are processed in a run-to-completion loop with very
+ * low interference from the operating system.
+ */
+ ODP_THREAD_WORKER = 0,
+
+ /**
+ * Control thread
+ *
+ * Control threads do not participate the main packet flow through the
+ * system, but e.g. control or monitor the worker threads, or handle
+ * exceptions. These threads may perform general purpose processing,
+ * use system calls, share the CPU with other threads and be interrupt
+ * driven.
+ */
+ ODP_THREAD_CONTROL
+} odp_thread_type_t;
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h
index 85af314be..d11c1671a 100644
--- a/include/odp/api/thread.h
+++ b/include/odp/api/thread.h
@@ -17,6 +17,8 @@
extern "C" {
#endif
+#include <odp/api/spec/thread_types.h>
+
#include <odp/api/abi/thread.h>
#include <odp/api/spec/thread.h>