aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Brooks <brian.brooks@linaro.org>2016-07-26 11:38:27 -0500
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-08-01 14:57:17 +0300
commitab966018496e7ebb0d1532d6c5c119b9db7d56fa (patch)
treeb15d9451d63ca15da8b3e812cc55a8137e7fc113
parent197710ffc229f3db775a97c27e09c2dc063497c4 (diff)
downloadodp-dpdk-ab966018496e7ebb0d1532d6c5c119b9db7d56fa.tar.gz
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>
-rw-r--r--platform/linux-generic/arch/default/odp/api/cpu_arch.h10
-rw-r--r--platform/linux-generic/arch/mips64/odp/api/cpu_arch.h12
-rw-r--r--platform/linux-generic/arch/powerpc/odp/api/cpu_arch.h10
-rw-r--r--platform/linux-generic/arch/x86/odp/api/cpu_arch.h10
-rw-r--r--platform/linux-generic/include/odp/api/align.h11
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 29f8889e..22b1da2d 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 7b5bfd25..3582b129 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 29f8889e..22b1da2d 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 3a16fa65..44e6b30e 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 d8bc6531..c238b80a 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
}