diff mbox series

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

Message ID 1519131613-30839-3-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v1,1/7] linux-gen: queue: encapsulate queue init/term_global functions | expand

Commit Message

Github ODP bot Feb. 20, 2018, 1 p.m. UTC
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: d5419e8857b2bc61d3be17fe53f171550fee426b
 ** Merge commit sha: e771b2cf674da116ae0cb9e7e5dca276e31fa112
 **/
 platform/linux-generic/include/odp_internal.h |  3 +++
 platform/linux-generic/odp_init.c             |  4 ++--
 platform/linux-generic/odp_schedule_if.c      | 11 +++++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h
index e36b084f1..ff58ec863 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 3900fb629..1f84ecd21 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 08ca813a9..e26634463 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;
@@ -134,3 +135,13 @@  void odp_schedule_order_unlock_lock(uint32_t unlock_index, uint32_t lock_index)
 {
 	sched_api->schedule_order_unlock_lock(unlock_index, lock_index);
 }
+
+int _odp_schedule_init_global(void)
+{
+	return sched_fn->init_global();
+}
+
+int _odp_schedule_term_global(void)
+{
+	return sched_fn->term_global();
+}