diff mbox

[v7,API-NEXT,06/12] linux-generic: sysinfo: move ARM system info codes to default arch file

Message ID 1453281662-31499-7-git-send-email-hongbo.zhang@linaro.org
State Superseded
Headers show

Commit Message

Hongbo Zhang Jan. 20, 2016, 9:20 a.m. UTC
From: Hongbo Zhang <hongbo.zhang@linaro.org>

This patch moves the ARM system info codes into the general arch file,
ARM sysinfo isn't implemented now and there is no need to create specific
arch file for it, but this can serve as the default implementaton instead.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
 platform/linux-generic/Makefile.am                    |  1 +
 platform/linux-generic/arch/linux/odp_sysinfo_parse.c | 19 +++++++++++++++++++
 platform/linux-generic/odp_system_info.c              | 15 +--------------
 3 files changed, 21 insertions(+), 14 deletions(-)
 create mode 100644 platform/linux-generic/arch/linux/odp_sysinfo_parse.c
diff mbox

Patch

diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index d3802f8..b737135 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -164,6 +164,7 @@  __LIB__libodp_la_SOURCES = \
 
 EXTRA_DIST = \
 	     arch/linux/odp_cpu_arch.c \
+	     arch/linux/odp_sysinfo_parse.c \
 	     arch/mips64/odp_cpu_arch.c \
 	     arch/mips64/odp_sysinfo_parse.c \
 	     arch/x86/odp_cpu_arch.c \
diff --git a/platform/linux-generic/arch/linux/odp_sysinfo_parse.c b/platform/linux-generic/arch/linux/odp_sysinfo_parse.c
new file mode 100644
index 0000000..881dd2d
--- /dev/null
+++ b/platform/linux-generic/arch/linux/odp_sysinfo_parse.c
@@ -0,0 +1,19 @@ 
+/* Copyright (c) 2016, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp_internal.h>
+#include <string.h>
+
+int odp_cpuinfo_parser(FILE *file ODP_UNUSED,
+		       odp_system_info_t *sysinfo ODP_UNUSED)
+{
+	return 0;
+}
+
+uint64_t odp_cpu_hz_current(int id ODP_UNUSED)
+{
+	return -1;
+}
diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c
index 2b8e2b8..27dad03 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -108,20 +108,7 @@  static int huge_page_size(void)
 /*
  * HW specific /proc/cpuinfo file parsing
  */
-#if defined __arm__ || defined __aarch64__
-
-static int odp_cpuinfo_parser(FILE *file ODP_UNUSED,
-			      odp_system_info_t *sysinfo ODP_UNUSED)
-{
-	return 0;
-}
-
-static uint64_t odp_cpu_hz_current(int id ODP_UNUSED)
-{
-	return -1;
-}
-
-#elif defined __powerpc__
+#if defined __powerpc__
 static int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
 {
 	char str[1024];