diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2015-11-20 14:32:43 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-12-29 14:07:51 +0300 |
commit | a0a794b5332091b3b780cb2379e3b02e0281aba1 (patch) | |
tree | 5b554f2e57dec881ff8ddabc5156477af2be974f /platform | |
parent | 0f8f4c6eb6ab0abdf6ce4480d2878a5618145e69 (diff) |
linux-generic: thread: removed internal max threads define
Replaced internal define with ODP_THREAD_COUNT_MAX. This
fixes also the current make install issue.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-generic/Makefile.am | 1 | ||||
-rw-r--r-- | platform/linux-generic/include/odp/plat/rwlock_recursive_types.h | 10 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_buffer_internal.h | 3 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_config_internal.h | 29 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_pool_internal.h | 3 | ||||
-rw-r--r-- | platform/linux-generic/odp_pool.c | 3 | ||||
-rw-r--r-- | platform/linux-generic/odp_thread.c | 11 | ||||
-rw-r--r-- | platform/linux-generic/odp_thrmask.c | 1 |
8 files changed, 15 insertions, 46 deletions
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 83822ca8f..8334b0c35 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -87,7 +87,6 @@ noinst_HEADERS = \ ${srcdir}/include/odp_classification_datamodel.h \ ${srcdir}/include/odp_classification_inlines.h \ ${srcdir}/include/odp_classification_internal.h \ - ${srcdir}/include/odp_config_internal.h \ ${srcdir}/include/odp_crypto_internal.h \ ${srcdir}/include/odp_debug_internal.h \ ${srcdir}/include/odp_forward_typedefs_internal.h \ diff --git a/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h b/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h index d5bfb9254..474751cf0 100644 --- a/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h +++ b/platform/linux-generic/include/odp/plat/rwlock_recursive_types.h @@ -19,14 +19,14 @@ extern "C" { #include <odp/rwlock.h> #include <odp/std_types.h> -#include <odp_config_internal.h> +#include <odp/thread.h> /** @internal */ struct odp_rwlock_recursive_s { - odp_rwlock_t lock; /**< the lock */ - int wr_owner; /**< write owner thread */ - uint32_t wr_cnt; /**< write recursion count */ - uint8_t rd_cnt[_ODP_INTERNAL_MAX_THREADS]; /**< read recursion count */ + odp_rwlock_t lock; /**< the lock */ + int wr_owner; /**< write owner thread */ + uint32_t wr_cnt; /**< write recursion count */ + uint8_t rd_cnt[ODP_THREAD_COUNT_MAX]; /**< read recursion count */ }; typedef struct odp_rwlock_recursive_s odp_rwlock_recursive_t; diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index 74a0b5c4f..abdd320b4 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -30,7 +30,6 @@ extern "C" { #include <odp/thread.h> #include <odp/event.h> #include <odp_forward_typedefs_internal.h> -#include <odp_config_internal.h> #define ODP_BITSIZE(x) \ ((x) <= 2 ? 1 : \ @@ -144,7 +143,7 @@ struct odp_buffer_hdr_t { /** @internal Compile time assert that the * allocator field can handle any allocator id*/ -_ODP_STATIC_ASSERT(INT16_MAX >= _ODP_INTERNAL_MAX_THREADS, +_ODP_STATIC_ASSERT(INT16_MAX >= ODP_THREAD_COUNT_MAX, "ODP_BUFFER_HDR_T__ALLOCATOR__SIZE_ERROR"); typedef struct odp_buffer_hdr_stride { diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h deleted file mode 100644 index 4f20ff8e0..000000000 --- a/platform/linux-generic/include/odp_config_internal.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * @file - * - * Linux-generic platform internal configuration - */ - -#ifndef ODP_CONFIG_INTERNAL_H_ -#define ODP_CONFIG_INTERNAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Maximum number of threads - */ -#define _ODP_INTERNAL_MAX_THREADS 128 - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h index 94bf1faee..b12bca8f6 100644 --- a/platform/linux-generic/include/odp_pool_internal.h +++ b/platform/linux-generic/include/odp_pool_internal.h @@ -29,6 +29,7 @@ extern "C" { #include <odp/shared_memory.h> #include <odp/atomic.h> #include <odp_atomic_internal.h> +#include <odp/thread.h> #include <string.h> /** @@ -139,7 +140,7 @@ struct pool_entry_s { uint32_t headroom; uint32_t tailroom; - local_cache_t local_cache[_ODP_INTERNAL_MAX_THREADS] ODP_ALIGNED_CACHE; + local_cache_t local_cache[ODP_THREAD_COUNT_MAX] ODP_ALIGNED_CACHE; }; typedef union pool_entry_u { diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 9859ff6d9..84d35bfba 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -17,6 +17,7 @@ #include <odp_internal.h> #include <odp/config.h> #include <odp/hints.h> +#include <odp/thread.h> #include <odp_debug_internal.h> #include <odp_atomic_internal.h> @@ -463,7 +464,7 @@ int odp_pool_destroy(odp_pool_t pool_hdl) } /* Make sure local caches are empty */ - for (i = 0; i < _ODP_INTERNAL_MAX_THREADS; i++) + for (i = 0; i < ODP_THREAD_COUNT_MAX; i++) flush_cache(&pool->s.local_cache[i], &pool->s); /* Call fails if pool has allocated buffers */ diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index 2f3934374..06a5dcd5d 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -18,7 +18,6 @@ #include <odp/shared_memory.h> #include <odp/align.h> #include <odp/cpu.h> -#include <odp_config_internal.h> #include <string.h> #include <stdio.h> @@ -32,7 +31,7 @@ typedef struct { typedef struct { - thread_state_t thr[_ODP_INTERNAL_MAX_THREADS]; + thread_state_t thr[ODP_THREAD_COUNT_MAX]; union { /* struct order must be kept in sync with schedule_types.h */ struct { @@ -102,10 +101,10 @@ static int alloc_id(odp_thread_type_t type) int thr; odp_thrmask_t *all = &thread_globals->all; - if (thread_globals->num >= _ODP_INTERNAL_MAX_THREADS) + if (thread_globals->num >= ODP_THREAD_COUNT_MAX) return -1; - for (thr = 0; thr < _ODP_INTERNAL_MAX_THREADS; thr++) { + for (thr = 0; thr < ODP_THREAD_COUNT_MAX; thr++) { if (odp_thrmask_isset(all, thr) == 0) { odp_thrmask_set(all, thr); @@ -129,7 +128,7 @@ static int free_id(int thr) { odp_thrmask_t *all = &thread_globals->all; - if (thr < 0 || thr >= _ODP_INTERNAL_MAX_THREADS) + if (thr < 0 || thr >= ODP_THREAD_COUNT_MAX) return -1; if (odp_thrmask_isset(all, thr) == 0) @@ -207,7 +206,7 @@ int odp_thread_count(void) int odp_thread_count_max(void) { - return _ODP_INTERNAL_MAX_THREADS; + return ODP_THREAD_COUNT_MAX; } odp_thread_type_t odp_thread_type(void) diff --git a/platform/linux-generic/odp_thrmask.c b/platform/linux-generic/odp_thrmask.c index b62d03c7a..154ae81b6 100644 --- a/platform/linux-generic/odp_thrmask.c +++ b/platform/linux-generic/odp_thrmask.c @@ -8,7 +8,6 @@ #define _GNU_SOURCE #endif -#include <odp_config_internal.h> #include <odp/thrmask.h> #include <odp/cpumask.h> |