diff mbox

[v5,4/8] linux-generic: create ARM files and move ARM ODP_CACHE_LINE_SIZE in it

Message ID 1456946992-19251-5-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.
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>
Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
---
 configure.ac                                       |  1 +
 platform/linux-generic/Makefile.am                 |  2 ++
 platform/linux-generic/arch/arm/odp/cpu_arch.h     | 32 ++++++++++++++++++++++
 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, 37 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 c9a146c..30a72e3 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 a9090a3..42c1657 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -157,6 +157,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..29f8889
--- /dev/null
+++ b/platform/linux-generic/arch/arm/odp/cpu_arch.h
@@ -0,0 +1,32 @@ 
+/* 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
+ *  @{
+ */
+
+#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