diff mbox

[v5,1/8] linux-generic: separate x86 ODP_CACHE_LINE_SIZE to its arch file

Message ID 1456946992-19251-2-git-send-email-mike.holmes@linaro.org
State New
Headers show

Commit Message

Mike Holmes March 2, 2016, 7:29 p.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: Mike Holmes <mike.holmes@linaro.org>
Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 configure.ac                                   |  1 +
 doc/application-api-guide/doxygen.cfg          |  1 +
 m4/ax_prog_doxygen.m4                          |  3 ++-
 platform/linux-generic/arch/x86/odp/cpu_arch.h | 10 ++++++++++
 platform/linux-generic/include/odp/align.h     |  9 ++-------
 5 files changed, 16 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index b6c6b1e..c9a146c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -393,6 +393,7 @@  AC_MSG_RESULT([
 	libdir:			${libdir}
 	includedir:		${includedir}
 	testdir:		${testdir}
+	WITH_ARCH:              ${WITH_ARCH}
 
 	cc:			${CC}
 	cppflags:		${CPPFLAGS}
diff --git a/doc/application-api-guide/doxygen.cfg b/doc/application-api-guide/doxygen.cfg
index 7951e9e..4d6506d 100644
--- a/doc/application-api-guide/doxygen.cfg
+++ b/doc/application-api-guide/doxygen.cfg
@@ -14,6 +14,7 @@  INPUT = $(SRCDIR)/doc \
 	$(SRCDIR)/doc/users-guide \
 	$(SRCDIR)/include \
 	$(SRCDIR)/platform/$(WITH_PLATFORM)/include/odp \
+	$(SRCDIR)/platform/$(WITH_PLATFORM)/arch/$(WITH_ARCH) \
 	$(SRCDIR)/helper/include
 FILE_PATTERNS = *.h odp*.c *.dox
 RECURSIVE = YES
diff --git a/m4/ax_prog_doxygen.m4 b/m4/ax_prog_doxygen.m4
index d0858ca..70baff8 100644
--- a/m4/ax_prog_doxygen.m4
+++ b/m4/ax_prog_doxygen.m4
@@ -270,6 +270,7 @@  DX_ENV_APPEND(SRCDIR, $srcdir)
 DX_ENV_APPEND(BUILDDIR, $builddir)
 DX_ENV_APPEND(VERSION, $VERSION)
 DX_ENV_APPEND(WITH_PLATFORM, $with_platform)
+DX_ENV_APPEND(WITH_ARCH, $ARCH)
 DX_ENV_APPEND(PROJECT, $DX_PROJECT)
 DX_ENV_APPEND(VERSION, $PACKAGE_VERSION)
 
@@ -607,4 +608,4 @@  echo DX_FLAG_html=$DX_FLAG_html
 #echo DX_FLAG_pdf=$DX_FLAG_pdf
 #echo DX_FLAG_ps=$DX_FLAG_ps
 #echo DX_ENV=$DX_ENV
-])
\ No newline at end of file
+])
diff --git a/platform/linux-generic/arch/x86/odp/cpu_arch.h b/platform/linux-generic/arch/x86/odp/cpu_arch.h
index 997a954..3a16fa6 100644
--- a/platform/linux-generic/arch/x86/odp/cpu_arch.h
+++ b/platform/linux-generic/arch/x86/odp/cpu_arch.h
@@ -11,6 +11,16 @@ 
 extern "C" {
 #endif
 
+/** @ingroup odp_compiler_optim
+ *  @{
+ */
+
+#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..161a302 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
@@ -65,6 +59,7 @@  extern "C" {
  * @}
  */
 
+#include <odp/cpu_arch.h>
 #include <odp/api/align.h>
 
 #ifdef __cplusplus