Replaced internal define with ODP_THREAD_COUNT_MAX. This
fixes also the current make install issue.

Signed-off-by: Petri Savolainen <petri.savolai...@nokia.com>
---
 platform/linux-generic/Makefile.am                 |  1 -
 .../include/odp/plat/rwlock_recursive_types.h      | 10 ++++----
 .../linux-generic/include/odp_buffer_internal.h    |  3 +--
 .../linux-generic/include/odp_config_internal.h    | 29 ----------------------
 platform/linux-generic/include/odp_pool_internal.h |  3 ++-
 platform/linux-generic/odp_pool.c                  |  3 ++-
 platform/linux-generic/odp_thread.c                | 11 ++++----
 platform/linux-generic/odp_thrmask.c               |  1 -
 8 files changed, 15 insertions(+), 46 deletions(-)
 delete mode 100644 platform/linux-generic/include/odp_config_internal.h

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index ca372eb..193ae2a 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -133,7 +133,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 d5bfb92..474751c 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 74a0b5c..abdd320 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 4f20ff8..0000000
--- 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 94bf1fa..b12bca8 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 9859ff6..84d35bf 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 2f39343..06a5dcd 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 b62d03c..154ae81 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>
 
-- 
2.6.2

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to