This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 09abf90268a0a5a2daf7c7e0ae37a2d7c35e87c5 (commit) from 88df2613cb91022233f9ec973f6ef338eb060f17 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 09abf90268a0a5a2daf7c7e0ae37a2d7c35e87c5 Author: Christophe Milard christophe.milard@linaro.org Date: Mon Sep 19 17:56:57 2016 +0200
linux-gen: using ODP instantiation pid as odp instance
Rather than using INSTANCE_ID (constant 0xdeadbeef), the ODP main instantiation process ID is used as instance ID in the linux-generic implementation. This is a simple way to guarantee instance uniqueness on linux systems.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-and-tested-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h index 8bad450..3429781 100644 --- a/platform/linux-generic/include/odp_internal.h +++ b/platform/linux-generic/include/odp_internal.h @@ -25,7 +25,6 @@ extern "C" {
extern __thread int __odp_errno;
-#define INSTANCE_ID 0xdeadbeef #define MAX_CPU_NUMBER 128
typedef struct { diff --git a/platform/linux-generic/odp_init.c b/platform/linux-generic/odp_init.c index f534759..77f4f8a 100644 --- a/platform/linux-generic/odp_init.c +++ b/platform/linux-generic/odp_init.c @@ -116,8 +116,7 @@ int odp_init_global(odp_instance_t *instance, goto init_failed; }
- /* Dummy support for single instance */ - *instance = INSTANCE_ID; + *instance = (odp_instance_t)odp_global_data.main_pid;
return 0;
@@ -128,7 +127,7 @@ init_failed:
int odp_term_global(odp_instance_t instance) { - if (instance != INSTANCE_ID) { + if (instance != (odp_instance_t)odp_global_data.main_pid) { ODP_ERR("Bad instance.\n"); return -1; } @@ -250,7 +249,7 @@ int odp_init_local(odp_instance_t instance, odp_thread_type_t thr_type) { enum init_stage stage = NO_INIT;
- if (instance != INSTANCE_ID) { + if (instance != (odp_instance_t)odp_global_data.main_pid) { ODP_ERR("Bad instance.\n"); goto init_fail; } diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index 4fe07ef..85228cd 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -2317,7 +2317,8 @@ static void *tm_system_thread(void *arg) uint32_t destroying, work_queue_cnt, timer_cnt; int rc;
- rc = odp_init_local(INSTANCE_ID, ODP_THREAD_WORKER); + rc = odp_init_local((odp_instance_t)odp_global_data.main_pid, + ODP_THREAD_WORKER); ODP_ASSERT(rc == 0); tm_group = arg;
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/include/odp_internal.h | 1 - platform/linux-generic/odp_init.c | 7 +++---- platform/linux-generic/odp_traffic_mngr.c | 3 ++- 3 files changed, 5 insertions(+), 6 deletions(-)
hooks/post-receive