aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/odp_init.c
diff options
context:
space:
mode:
authorChristophe Milard <christophe.milard@linaro.org>2016-08-20 09:45:58 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2017-01-12 18:01:11 +0300
commit2eb3e87bc56b2a02cb10637e5ce3a7d1157472cf (patch)
tree7b65e5ab294644052393ac6db93adba7f5034f58 /platform/linux-generic/odp_init.c
parentba203281cfd10b88a5d5b8f143ea34d14d373b58 (diff)
linux-gen: ishm: internal shared memory allocator (ishm) added
A new ODP internal memory allocator, called ishm (for internal shmem) is introduced here. This memory allocator enables the following: - works for odpthreads being linux processes, regardless for fork time. - guarantees the uniqueness of the virtual space mapping address over all ODP threads (even processes and regardless of fork time), when the required _ODP_ISHM_SINGLE_VA flag is used. Signed-off-by: Christophe Milard <christophe.milard@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Reviewed-by: Brian Brooks <brian.brooks@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/odp_init.c')
-rw-r--r--platform/linux-generic/odp_init.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c
index a078533d9..43d9e400b 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -114,6 +114,12 @@ int odp_init_global(odp_instance_t *instance,
}
stage = FDSERVER_INIT;
+ if (_odp_ishm_init_global()) {
+ ODP_ERR("ODP ishm init failed.\n");
+ goto init_failed;
+ }
+ stage = ISHM_INIT;
+
if (odp_shm_init_global()) {
ODP_ERR("ODP shm init failed.\n");
goto init_failed;
@@ -280,6 +286,13 @@ int _odp_term_global(enum init_stage stage)
}
/* Fall through */
+ case ISHM_INIT:
+ if (_odp_ishm_term_global()) {
+ ODP_ERR("ODP ishm term failed.\n");
+ rc = -1;
+ }
+ /* Fall through */
+
case FDSERVER_INIT:
if (_odp_fdserver_term_global()) {
ODP_ERR("ODP fdserver term failed.\n");
@@ -324,6 +337,12 @@ int odp_init_local(odp_instance_t instance, odp_thread_type_t thr_type)
goto init_fail;
}
+ if (_odp_ishm_init_local()) {
+ ODP_ERR("ODP ishm local init failed.\n");
+ goto init_fail;
+ }
+ stage = ISHM_INIT;
+
if (odp_shm_init_local()) {
ODP_ERR("ODP shm local init failed.\n");
goto init_fail;
@@ -399,6 +418,13 @@ int _odp_term_local(enum init_stage stage)
}
/* Fall through */
+ case ISHM_INIT:
+ if (_odp_ishm_term_local()) {
+ ODP_ERR("ODP ishm local term failed.\n");
+ rc = -1;
+ }
+ /* Fall through */
+
default:
break;
}