diff mbox

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

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

Commit Message

Hongbo Zhang Jan. 7, 2016, 7:38 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 +
 .../linux-generic/arch/linux/odp_sysinfo_parse.c     | 20 ++++++++++++++++++++
 platform/linux-generic/odp_system_info.c             | 15 +--------------
 3 files changed, 22 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 bb0faf0..9bc96ff 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -163,6 +163,7 @@  __LIB__libodp_la_SOURCES = \
 
 EXTRA_DIST = \
 	     arch/linux/odp_cpu_cycles.c \
+	     arch/linux/odp_sysinfo_parse.c \
 	     arch/mips64/odp_cpu_cycles.c \
 	     arch/mips64/odp_sysinfo_parse.c \
 	     arch/x86/odp_cpu_cycles.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..ba792b2
--- /dev/null
+++ b/platform/linux-generic/arch/linux/odp_sysinfo_parse.c
@@ -0,0 +1,20 @@ 
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:     BSD-3-Clause
+ */
+
+#include <odp_internal.h>
+#include <odp_cpu_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 8a151eb..158a6b9 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -109,20 +109,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];