diff mbox

[v2,API-NEXT,1/4] linux-generic: separate x86 ODP_CACHE_LINE_SIZE to its arch file

Message ID 1454066534-32694-2-git-send-email-hongbo.zhang@linaro.org
State New
Headers show

Commit Message

Hongbo Zhang Jan. 29, 2016, 11:22 a.m. UTC
From: Hongbo Zhang <hongbo.zhang@linaro.org>

Currently all ODP_CACHE_LINE_SIZE macros for different architectures are
held in one header file, they should be moved to their own arch file.
This patch moves ODP_CACHE_LINE_SIZE for x86.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
 platform/linux-generic/arch/x86/odp/cpu_arch.h      | 2 ++
 platform/linux-generic/include/odp/align.h          | 8 +-------
 platform/linux-generic/include/odp_align_internal.h | 1 +
 3 files changed, 4 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-generic/arch/x86/odp/cpu_arch.h b/platform/linux-generic/arch/x86/odp/cpu_arch.h
index 997a954..24903ac 100644
--- a/platform/linux-generic/arch/x86/odp/cpu_arch.h
+++ b/platform/linux-generic/arch/x86/odp/cpu_arch.h
@@ -11,6 +11,8 @@ 
 extern "C" {
 #endif
 
+#define ODP_CACHE_LINE_SIZE 64
+
 static inline void odp_cpu_pause(void)
 {
 #ifdef __SSE2__
diff --git a/platform/linux-generic/include/odp/align.h b/platform/linux-generic/include/odp/align.h
index be8c9ae..4e045c6 100644
--- a/platform/linux-generic/include/odp/align.h
+++ b/platform/linux-generic/include/odp/align.h
@@ -31,11 +31,7 @@  extern "C" {
 
 #define ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member)
 
-#if defined __x86_64__ || defined __i386__
-
-#define ODP_CACHE_LINE_SIZE 64
-
-#elif defined __arm__ || defined __aarch64__
+#if defined __arm__ || defined __aarch64__
 
 #define ODP_CACHE_LINE_SIZE 64
 
@@ -47,8 +43,6 @@  extern "C" {
 
 #define ODP_CACHE_LINE_SIZE 64
 
-#else
-#error GCC target not found
 #endif
 
 #else
diff --git a/platform/linux-generic/include/odp_align_internal.h b/platform/linux-generic/include/odp_align_internal.h
index 4ca5ceb..99788e3 100644
--- a/platform/linux-generic/include/odp_align_internal.h
+++ b/platform/linux-generic/include/odp_align_internal.h
@@ -18,6 +18,7 @@  extern "C" {
 #endif
 
 #include <odp/align.h>
+#include <odp/cpu_arch.h>
 
 /** @addtogroup odp_compiler_optim
  *  @{