diff mbox

[v3,API-NEXT,4/4] linux-generic: create ARM files and move ARM ODP_CACHE_LINE_SIZE in it

Message ID 1454662607-28792-5-git-send-email-hongbo.zhang@linaro.org
State Superseded
Headers show

Commit Message

Hongbo Zhang Feb. 5, 2016, 8:56 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.
And in the legacy codes there was no ARM architecture directory, so this
patch create it, the odp_cpu_arch.c and odp_sysinfo_parse.c are still
symlink to the general default ones under arch/linux/, and a real file
arm/odp/cpu_arch.h is created from the linux/odp/cpu_arch.h, and then the
ODP_CACHE_LINE_SIZE for ARM is moved to this arch specific file.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
 configure.ac                                       |  1 +
 platform/linux-generic/Makefile.am                 |  2 ++
 platform/linux-generic/arch/arm/odp/cpu_arch.h     | 36 ++++++++++++++++++++++
 platform/linux-generic/arch/arm/odp_cpu_arch.c     |  1 +
 .../linux-generic/arch/arm/odp_sysinfo_parse.c     |  1 +
 platform/linux-generic/include/odp/align.h         |  6 ----
 6 files changed, 41 insertions(+), 6 deletions(-)
 create mode 100644 platform/linux-generic/arch/arm/odp/cpu_arch.h
 create mode 120000 platform/linux-generic/arch/arm/odp_cpu_arch.c
 create mode 120000 platform/linux-generic/arch/arm/odp_sysinfo_parse.c
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index add8308..eab1753 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,7 @@  AX_VALGRIND_CHECK
 ##########################################################################
 AS_CASE([$host],
   [x86*], [ARCH=x86],
+  [arm*], [ARCH=arm],
   [mips64*], [ARCH=mips64],
   [powerpc*], [ARCH=powerpc],
   [ARCH=linux]
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 94f1408..c242d8c 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -169,6 +169,8 @@  __LIB__libodp_la_SOURCES = \
 EXTRA_DIST = \
 	     arch/linux/odp_cpu_arch.c \
 	     arch/linux/odp_sysinfo_parse.c \
+	     arch/arm/odp_cpu_arch.c \
+	     arch/arm/odp_sysinfo_parse.c \
 	     arch/mips64/odp_cpu_arch.c \
 	     arch/mips64/odp_sysinfo_parse.c \
 	     arch/powerpc/odp_cpu_arch.c \
diff --git a/platform/linux-generic/arch/arm/odp/cpu_arch.h b/platform/linux-generic/arch/arm/odp/cpu_arch.h
new file mode 100644
index 0000000..5539185
--- /dev/null
+++ b/platform/linux-generic/arch/arm/odp/cpu_arch.h
@@ -0,0 +1,36 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef ODP_PLAT_CPU_ARCH_H_
+#define ODP_PLAT_CPU_ARCH_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @ingroup odp_compiler_optim
+ *  @{
+ */
+
+/**
+ * @def ODP_CACHE_LINE_SIZE
+ * Cache line size
+ */
+#define ODP_CACHE_LINE_SIZE 64
+
+/**
+ * @}
+ */
+
+static inline void odp_cpu_pause(void)
+{
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c
new file mode 120000
index 0000000..c5fe400
--- /dev/null
+++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c
@@ -0,0 +1 @@ 
+../linux/odp_cpu_arch.c
\ No newline at end of file
diff --git a/platform/linux-generic/arch/arm/odp_sysinfo_parse.c b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
new file mode 120000
index 0000000..2f368af
--- /dev/null
+++ b/platform/linux-generic/arch/arm/odp_sysinfo_parse.c
@@ -0,0 +1 @@ 
+../linux/odp_sysinfo_parse.c
\ No newline at end of file
diff --git a/platform/linux-generic/include/odp/align.h b/platform/linux-generic/include/odp/align.h
index 46b30dc..d824d57 100644
--- a/platform/linux-generic/include/odp/align.h
+++ b/platform/linux-generic/include/odp/align.h
@@ -31,12 +31,6 @@  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