diff options
author | Brian Brooks <brian.brooks@linaro.org> | 2016-07-26 11:38:27 -0500 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-08-01 14:57:17 +0300 |
commit | ab966018496e7ebb0d1532d6c5c119b9db7d56fa (patch) | |
tree | b15d9451d63ca15da8b3e812cc55a8137e7fc113 | |
parent | 197710ffc229f3db775a97c27e09c2dc063497c4 (diff) |
linux-generic: internal cache line size
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>
Reviewed-by: Christophe Milard <christophe.milard@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
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 29f8889ec..22b1da2dd 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 7b5bfd256..3582b129b 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 29f8889ec..22b1da2dd 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 3a16fa65e..44e6b30ed 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 d8bc65312..c238b80af 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 } |