Message ID | 1447206173-31970-3-git-send-email-bill.fischofer@linaro.org |
---|---|
State | New |
Headers | show |
Do you want to revise your patch to do this? I'm just looking for a simple way of resolving the compile issue. The alternative would be to move the #define you're currently using to a public platform file (e.g., platform/linux-generic/include/odp/plat/rwlock_recursive_types.h On Wed, Nov 11, 2015 at 4:04 AM, Savolainen, Petri (Nokia - FI/Espoo) < petri.savolainen@nokia.com> wrote: > The problem should be solved by shared memory alloc, instead of using > #define. We should minimize #defines in the API. > > -Petri > > > > -----Original Message----- > > From: lng-odp [mailto:lng-odp-bounces@lists.linaro.org] On Behalf Of > > EXT Bill Fischofer > > Sent: Wednesday, November 11, 2015 3:43 AM > > To: lng-odp@lists.linaro.org > > Subject: [lng-odp] [API-NEXT PATCH 3/3] linux-generic: locks: revise > > implementation of recursive rwlocks > > > > Change linux-generic implementation of rwlock_recursive types to > > reference the externally visible ODP_CONFIG_THREADS symbol rather than > > the internal _ODP_INTERNAL_MAX_THREADS symbol. This avoids causing > > issues with installed copies of ODP that do not export internal > > symbols. > > > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > > --- > > platform/linux-generic/include/odp/plat/rwlock_recursive_types.h | 4 > > ++-- > > platform/linux-generic/include/odp_config_internal.h | 2 > > +- > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > > 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..5989e26 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/config.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 */ > > + uint8_t rd_cnt[ODP_CONFIG_THREADS]; /**< read recursion > > count */ > > }; > > > > typedef struct odp_rwlock_recursive_s odp_rwlock_recursive_t; > > diff --git a/platform/linux-generic/include/odp_config_internal.h > > b/platform/linux-generic/include/odp_config_internal.h > > index 4f20ff8..c484ce6 100644 > > --- a/platform/linux-generic/include/odp_config_internal.h > > +++ b/platform/linux-generic/include/odp_config_internal.h > > @@ -20,7 +20,7 @@ extern "C" { > > /** > > * Maximum number of threads > > */ > > -#define _ODP_INTERNAL_MAX_THREADS 128 > > +#define _ODP_INTERNAL_MAX_THREADS ODP_CONFIG_THREADS > > > > #ifdef __cplusplus > > } > > -- > > 2.1.4 > > > > _______________________________________________ > > lng-odp mailing list > > lng-odp@lists.linaro.org > > https://lists.linaro.org/mailman/listinfo/lng-odp >
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..5989e26 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/config.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 */ + uint8_t rd_cnt[ODP_CONFIG_THREADS]; /**< read recursion count */ }; typedef struct odp_rwlock_recursive_s odp_rwlock_recursive_t; diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 4f20ff8..c484ce6 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -20,7 +20,7 @@ extern "C" { /** * Maximum number of threads */ -#define _ODP_INTERNAL_MAX_THREADS 128 +#define _ODP_INTERNAL_MAX_THREADS ODP_CONFIG_THREADS #ifdef __cplusplus }
Change linux-generic implementation of rwlock_recursive types to reference the externally visible ODP_CONFIG_THREADS symbol rather than the internal _ODP_INTERNAL_MAX_THREADS symbol. This avoids causing issues with installed copies of ODP that do not export internal symbols. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/include/odp/plat/rwlock_recursive_types.h | 4 ++-- platform/linux-generic/include/odp_config_internal.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)