[v6,2/7] linux-gen: sched: encapsulate sched init/term_global functions

Message ID 1519761641-21081-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • Select scheduler+queue in runtime, basing on environment
Related show

Commit Message

Github ODP bot Feb. 27, 2018, 8 p.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Hide calling into sched_fn into sched_if module.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 467 (lumag:sched-env)
 ** https://github.com/Linaro/odp/pull/467
 ** Patch: https://github.com/Linaro/odp/pull/467.patch
 ** Base sha: 3984ba4cd16a02e3fa98ccd432a06663de3fa993
 ** Merge commit sha: 62438643661dee1350bce73f90120c824538df8b
 **/
 platform/linux-generic/include/odp_internal.h |  3 +++
 platform/linux-generic/odp_init.c             |  4 ++--
 platform/linux-generic/odp_schedule_if.c      | 10 ++++++++++
 3 files changed, 15 insertions(+), 2 deletions(-)

Patch

diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h
index b8d791544..c21228982 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -103,6 +103,9 @@  int odp_pool_term_local(void);
 int _odp_queue_init_global(void);
 int _odp_queue_term_global(void);
 
+int _odp_schedule_init_global(void);
+int _odp_schedule_term_global(void);
+
 int odp_pktio_init_global(void);
 int odp_pktio_term_global(void);
 int odp_pktio_init_local(void);
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
index aa0885dab..325c1fb92 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -96,7 +96,7 @@  int odp_init_global(odp_instance_t *instance,
 	}
 	stage = QUEUE_INIT;
 
-	if (sched_fn->init_global()) {
+	if (_odp_schedule_init_global()) {
 		ODP_ERR("ODP schedule init failed.\n");
 		goto init_failed;
 	}
@@ -231,7 +231,7 @@  int _odp_term_global(enum init_stage stage)
 		/* Fall through */
 
 	case SCHED_INIT:
-		if (sched_fn->term_global()) {
+		if (_odp_schedule_term_global()) {
 			ODP_ERR("ODP schedule term failed.\n");
 			rc = -1;
 		}
diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c
index 6a3b4e4ba..71d4ee75c 100644
--- a/platform/linux-generic/odp_schedule_if.c
+++ b/platform/linux-generic/odp_schedule_if.c
@@ -7,6 +7,7 @@ 
 #include "config.h"
 
 #include <odp_schedule_if.h>
+#include <odp_internal.h>
 
 extern const schedule_fn_t schedule_sp_fn;
 extern const schedule_api_t schedule_sp_api;
@@ -145,3 +146,12 @@  void odp_schedule_order_lock_wait(uint32_t lock_index)
 	sched_api->schedule_order_lock_wait(lock_index);
 }
 
+int _odp_schedule_init_global(void)
+{
+	return sched_fn->init_global();
+}
+
+int _odp_schedule_term_global(void)
+{
+	return sched_fn->term_global();
+}