[v1,1/7] build: support building for generic arch

Message ID 1518595221-854-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • non-optimized (default) host support
Related show

Commit Message

Github ODP bot Feb. 14, 2018, 8 a.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Support building ODP for generic architecture, using default ARCH code.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 462 (lumag:default-abi)
 ** https://github.com/Linaro/odp/pull/462
 ** Patch: https://github.com/Linaro/odp/pull/462.patch
 ** Base sha: 41b3fa2cd994a7ef68290a07dcde5564e4640847
 ** Merge commit sha: 92a3ed64c30441cbca76e6f8ab5c086fe0c83a18
 **/
 configure.ac                                       |  8 ++++----
 platform/linux-generic/Makefile.am                 | 10 +++++++++
 .../linux-generic/arch/default/odp/api/abi/cpu.h   | 24 ++++++++++++++++++++++
 3 files changed, 38 insertions(+), 4 deletions(-)
 create mode 100644 platform/linux-generic/arch/default/odp/api/abi/cpu.h

Patch

diff --git a/configure.ac b/configure.ac
index a44a2ec6f..97f0af400 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,17 +159,16 @@  AS_CASE([$host],
   [powerpc*], [ARCH_DIR=powerpc],
   [aarch64*], [ARCH_DIR=aarch64],
   [arm*], [ARCH_DIR=arm],
-  [ARCH_DIR=undefined]
+  [ARCH_DIR=default]
 )
 AC_SUBST([ARCH_DIR])
 
 ##########################################################################
 # Warn on the defaults if arch is undefined
 ##########################################################################
-if test "${ARCH_DIR}" = "undefined";
+if test "${ARCH_DIR}" = "default";
 then
-    echo "ARCH_DIR is undefined, please add your ARCH_DIR based on host=${host}"
-    exit 1
+    AC_MSG_WARN([ARCH_DIR is undefined, please add your ARCH_DIR based on host=${host}])
 fi
 
 ##########################################################################
@@ -280,6 +279,7 @@  AM_CONDITIONAL([HAVE_MSCGEN], [test "x${MSCGEN}" = "xmscgen"])
 AM_CONDITIONAL([helper_linux], [test x$helper_linux = xyes ])
 AM_CONDITIONAL([ARCH_IS_ARM], [test "x${ARCH_DIR}" = "xarm"])
 AM_CONDITIONAL([ARCH_IS_AARCH64], [test "x${ARCH_DIR}" = "xaarch64"])
+AM_CONDITIONAL([ARCH_IS_DEFAULT], [test "x${ARCH_DIR}" = "xdefault"])
 AM_CONDITIONAL([ARCH_IS_MIPS64], [test "x${ARCH_DIR}" = "xmips64"])
 AM_CONDITIONAL([ARCH_IS_POWERPC], [test "x${ARCH_DIR}" = "xpowerpc"])
 AM_CONDITIONAL([ARCH_IS_X86], [test "x${ARCH_DIR}" = "xx86"])
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 9e82f2622..bb5bc8134 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -241,6 +241,16 @@  noinst_HEADERS += arch/aarch64/odp_atomic.h \
 		  arch/default/odp_cpu_idling.h \
 		  arch/aarch64/odp_llsc.h
 endif
+if ARCH_IS_DEFAULT
+__LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_cycles.c \
+				  arch/default/odp_global_time.c \
+				  arch/default/odp_sysinfo_parse.c
+if !ODP_ABI_COMPAT
+odpapiabiarchinclude_HEADERS += arch/default/odp/api/abi/cpu.h
+endif
+noinst_HEADERS += arch/default/odp_cpu.h \
+		  arch/default/odp_cpu_idling.h
+endif
 if ARCH_IS_MIPS64
 __LIB__libodp_linux_la_SOURCES += arch/mips64/odp_cpu_cycles.c \
 				  arch/default/odp_global_time.c \
diff --git a/platform/linux-generic/arch/default/odp/api/abi/cpu.h b/platform/linux-generic/arch/default/odp/api/abi/cpu.h
new file mode 100644
index 000000000..0765339b4
--- /dev/null
+++ b/platform/linux-generic/arch/default/odp/api/abi/cpu.h
@@ -0,0 +1,24 @@ 
+/* Copyright (c) 2018, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#ifndef ODP_API_ABI_CPU_H_
+#define ODP_API_ABI_CPU_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ODP_CACHE_LINE_SIZE 64
+
+static inline void odp_cpu_pause(void)
+{
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif