Message ID | 20160726163827.95668-1-brian.brooks@linaro.org |
---|---|
State | New |
Headers | show |
Merged, Maxim. On 07/26/16 19:38, Brian Brooks wrote: > Define the ODP API for cache line size to the cache line size defined > in the internal architecture directories. Prefix internal cache line > size identifier with '_odp'. > > Signed-off-by: Brian Brooks <brian.brooks@linaro.org> > --- > platform/linux-generic/arch/default/odp/api/cpu_arch.h | 10 +--------- > platform/linux-generic/arch/mips64/odp/api/cpu_arch.h | 12 +++--------- > platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h | 10 +--------- > platform/linux-generic/arch/x86/odp/api/cpu_arch.h | 10 +--------- > platform/linux-generic/include/odp/api/align.h | 11 ++++------- > 5 files changed, 10 insertions(+), 43 deletions(-) > > diff --git a/platform/linux-generic/arch/default/odp/api/cpu_arch.h b/platform/linux-generic/arch/default/odp/api/cpu_arch.h > index 29f8889..22b1da2 100644 > --- a/platform/linux-generic/arch/default/odp/api/cpu_arch.h > +++ b/platform/linux-generic/arch/default/odp/api/cpu_arch.h > @@ -11,15 +11,7 @@ > extern "C" { > #endif > > -/** @ingroup odp_compiler_optim > - * @{ > - */ > - > -#define ODP_CACHE_LINE_SIZE 64 > - > -/** > - * @} > - */ > +#define _ODP_CACHE_LINE_SIZE 64 > > static inline void odp_cpu_pause(void) > { > diff --git a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h > index 7b5bfd2..3582b12 100644 > --- a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h > +++ b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h > @@ -11,18 +11,12 @@ > extern "C" { > #endif > > -/** @ingroup odp_compiler_optim > - * @{ > - */ > - > #if defined __OCTEON__ > -#define ODP_CACHE_LINE_SIZE 128 > +#define _ODP_CACHE_LINE_SIZE 128 > +#else > +#error Please add support for your arch in cpu_arch.h > #endif > > -/** > - * @} > - */ > - > static inline void odp_cpu_pause(void) > { > __asm__ __volatile__ ("nop"); > diff --git a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h > index 29f8889..22b1da2 100644 > --- a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h > +++ b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h > @@ -11,15 +11,7 @@ > extern "C" { > #endif > > -/** @ingroup odp_compiler_optim > - * @{ > - */ > - > -#define ODP_CACHE_LINE_SIZE 64 > - > -/** > - * @} > - */ > +#define _ODP_CACHE_LINE_SIZE 64 > > static inline void odp_cpu_pause(void) > { > diff --git a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h > index 3a16fa6..44e6b30 100644 > --- a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h > +++ b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h > @@ -11,15 +11,7 @@ > extern "C" { > #endif > > -/** @ingroup odp_compiler_optim > - * @{ > - */ > - > -#define ODP_CACHE_LINE_SIZE 64 > - > -/** > - * @} > - */ > +#define _ODP_CACHE_LINE_SIZE 64 > > static inline void odp_cpu_pause(void) > { > diff --git a/platform/linux-generic/include/odp/api/align.h b/platform/linux-generic/include/odp/api/align.h > index d8bc653..c238b80 100644 > --- a/platform/linux-generic/include/odp/api/align.h > +++ b/platform/linux-generic/include/odp/api/align.h > @@ -17,6 +17,8 @@ > extern "C" { > #endif > > +#include <odp/api/cpu_arch.h> > + > /** @ingroup odp_compiler_optim > * @{ > */ > @@ -31,16 +33,12 @@ extern "C" { > > #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member) > > -#if defined __arm__ || defined __aarch64__ > - > -#define ODP_CACHE_LINE_SIZE 64 > - > -#endif > - > #else > #error Non-gcc compatible compiler > #endif > > +#define ODP_CACHE_LINE_SIZE _ODP_CACHE_LINE_SIZE > + > #define ODP_PAGE_SIZE 4096 > > #define ODP_ALIGNED_CACHE ODP_ALIGNED(ODP_CACHE_LINE_SIZE) > @@ -52,7 +50,6 @@ extern "C" { > */ > > #include <odp/api/spec/align.h> > -#include <odp/api/cpu_arch.h> > > #ifdef __cplusplus > }
diff --git a/platform/linux-generic/arch/default/odp/api/cpu_arch.h b/platform/linux-generic/arch/default/odp/api/cpu_arch.h index 29f8889..22b1da2 100644 --- a/platform/linux-generic/arch/default/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/default/odp/api/cpu_arch.h @@ -11,15 +11,7 @@ extern "C" { #endif -/** @ingroup odp_compiler_optim - * @{ - */ - -#define ODP_CACHE_LINE_SIZE 64 - -/** - * @} - */ +#define _ODP_CACHE_LINE_SIZE 64 static inline void odp_cpu_pause(void) { diff --git a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h index 7b5bfd2..3582b12 100644 --- a/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/mips64/odp/api/cpu_arch.h @@ -11,18 +11,12 @@ extern "C" { #endif -/** @ingroup odp_compiler_optim - * @{ - */ - #if defined __OCTEON__ -#define ODP_CACHE_LINE_SIZE 128 +#define _ODP_CACHE_LINE_SIZE 128 +#else +#error Please add support for your arch in cpu_arch.h #endif -/** - * @} - */ - static inline void odp_cpu_pause(void) { __asm__ __volatile__ ("nop"); diff --git a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h index 29f8889..22b1da2 100644 --- a/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h @@ -11,15 +11,7 @@ extern "C" { #endif -/** @ingroup odp_compiler_optim - * @{ - */ - -#define ODP_CACHE_LINE_SIZE 64 - -/** - * @} - */ +#define _ODP_CACHE_LINE_SIZE 64 static inline void odp_cpu_pause(void) { diff --git a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h index 3a16fa6..44e6b30 100644 --- a/platform/linux-generic/arch/x86/odp/api/cpu_arch.h +++ b/platform/linux-generic/arch/x86/odp/api/cpu_arch.h @@ -11,15 +11,7 @@ extern "C" { #endif -/** @ingroup odp_compiler_optim - * @{ - */ - -#define ODP_CACHE_LINE_SIZE 64 - -/** - * @} - */ +#define _ODP_CACHE_LINE_SIZE 64 static inline void odp_cpu_pause(void) { diff --git a/platform/linux-generic/include/odp/api/align.h b/platform/linux-generic/include/odp/api/align.h index d8bc653..c238b80 100644 --- a/platform/linux-generic/include/odp/api/align.h +++ b/platform/linux-generic/include/odp/api/align.h @@ -17,6 +17,8 @@ extern "C" { #endif +#include <odp/api/cpu_arch.h> + /** @ingroup odp_compiler_optim * @{ */ @@ -31,16 +33,12 @@ extern "C" { #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member) -#if defined __arm__ || defined __aarch64__ - -#define ODP_CACHE_LINE_SIZE 64 - -#endif - #else #error Non-gcc compatible compiler #endif +#define ODP_CACHE_LINE_SIZE _ODP_CACHE_LINE_SIZE + #define ODP_PAGE_SIZE 4096 #define ODP_ALIGNED_CACHE ODP_ALIGNED(ODP_CACHE_LINE_SIZE) @@ -52,7 +50,6 @@ extern "C" { */ #include <odp/api/spec/align.h> -#include <odp/api/cpu_arch.h> #ifdef __cplusplus }
Define the ODP API for cache line size to the cache line size defined in the internal architecture directories. Prefix internal cache line size identifier with '_odp'. Signed-off-by: Brian Brooks <brian.brooks@linaro.org> --- platform/linux-generic/arch/default/odp/api/cpu_arch.h | 10 +--------- platform/linux-generic/arch/mips64/odp/api/cpu_arch.h | 12 +++--------- platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h | 10 +--------- platform/linux-generic/arch/x86/odp/api/cpu_arch.h | 10 +--------- platform/linux-generic/include/odp/api/align.h | 11 ++++------- 5 files changed, 10 insertions(+), 43 deletions(-) -- 2.9.0