aboutsummaryrefslogtreecommitdiff
path: root/helper/include
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@linaro.org>2017-02-03 13:23:59 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-02-16 23:30:27 +0300
commitaf5205809e3921ea0c4db5771ea1da5d2f0eaaf5 (patch)
tree792e274bcd065b57a31c67ce455f16c96640ee4d /helper/include
parent32b94edb4961a3ac1a2e5c90f65ee3f118852151 (diff)
helper: linux: renamed threads_extn to linux helpers
There's no platform specific helpers. Helpers may depend on Linux and make it easier to do common series of Linux system calls. These kind of helpers are grouped into helper/linux directory. Use --enable-helper-linux configuration option to enable support for Linux helpers. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Mike Holmes <mike.holmes@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper/include')
-rw-r--r--helper/include/odp/helper/linux/process.h (renamed from helper/include/odp/helper/platform/linux-generic/threads_extn.h)44
-rw-r--r--helper/include/odp/helper/linux/pthread.h66
2 files changed, 74 insertions, 36 deletions
diff --git a/helper/include/odp/helper/platform/linux-generic/threads_extn.h b/helper/include/odp/helper/linux/process.h
index 1d4036db7..9d74146b0 100644
--- a/helper/include/odp/helper/platform/linux-generic/threads_extn.h
+++ b/helper/include/odp/helper/linux/process.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, Linaro Limited
+/* Copyright (c) 2017, Linaro Limited
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
@@ -7,15 +7,15 @@
/**
* @file
*
- * ODP Linux helper extension API
+ * ODP Linux helper for processes
*
- * This file is an optional helper to odp.h APIs. These functions are provided
- * to ease common setups in a Linux system. User is free to implement the same
- * setups in otherways (not via this API).
+ * This file is not part of ODP APIs, but can be optionally used to ease common
+ * setups in a Linux system. User is free to implement the same setups in
+ * otherways (not via this file).
*/
-#ifndef ODPH_LINUX_EXT_H_
-#define ODPH_LINUX_EXT_H_
+#ifndef ODPH_LINUX_PROCESS_H_
+#define ODPH_LINUX_PROCESS_H_
#include <odp/helper/threads.h>
@@ -23,39 +23,11 @@
extern "C" {
#endif
-/** @addtogroup odph_linux ODPH LINUX
+/** @ingroup odph_linux
* @{
*/
/**
- * Creates and launches pthreads
- *
- * Creates, pins and launches threads to separate CPU's based on the cpumask.
- *
- * @param[out] pthread_tbl Table of pthread state information records. Table
- * must have at least as many entries as there are
- * CPUs in the CPU mask.
- * @param mask CPU mask
- * @param thr_params Linux helper thread parameters
- *
- * @return Number of threads created
- */
-int odph_linux_pthread_create(odph_linux_pthread_t *pthread_tbl,
- const odp_cpumask_t *mask,
- const odph_linux_thr_params_t *thr_params);
-
-/**
- * Waits pthreads to exit
- *
- * Returns when all threads have been exit.
- *
- * @param thread_tbl Thread table
- * @param num Number of threads to create
- *
- */
-void odph_linux_pthread_join(odph_linux_pthread_t *thread_tbl, int num);
-
-/**
* Fork a process
*
* Forks and sets CPU affinity for the child process. Ignores 'start' and 'arg'
diff --git a/helper/include/odp/helper/linux/pthread.h b/helper/include/odp/helper/linux/pthread.h
new file mode 100644
index 000000000..feeda5e28
--- /dev/null
+++ b/helper/include/odp/helper/linux/pthread.h
@@ -0,0 +1,66 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP Linux helper for pthreads
+ *
+ * This file is not part of ODP APIs, but can be optionally used to ease common
+ * setups in a Linux system. User is free to implement the same setups in
+ * otherways (not via this file).
+ */
+
+#ifndef ODPH_LINUX_PTHREAD_H_
+#define ODPH_LINUX_PTHREAD_H_
+
+#include <odp/helper/threads.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup odph_linux
+ * @{
+ */
+
+/**
+ * Creates and launches pthreads
+ *
+ * Creates, pins and launches threads to separate CPU's based on the cpumask.
+ *
+ * @param[out] pthread_tbl Table of pthread state information records. Table
+ * must have at least as many entries as there are
+ * CPUs in the CPU mask.
+ * @param mask CPU mask
+ * @param thr_params Linux helper thread parameters
+ *
+ * @return Number of threads created
+ */
+int odph_linux_pthread_create(odph_linux_pthread_t *pthread_tbl,
+ const odp_cpumask_t *mask,
+ const odph_linux_thr_params_t *thr_params);
+
+/**
+ * Waits pthreads to exit
+ *
+ * Returns when all threads have been exit.
+ *
+ * @param thread_tbl Thread table
+ * @param num Number of threads to create
+ *
+ */
+void odph_linux_pthread_join(odph_linux_pthread_t *thread_tbl, int num);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif