aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c')
-rw-r--r--platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
index bd4b9b429..519ca62ed 100644
--- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
@@ -1,13 +1,13 @@
-/* Copyright (c) 2016, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright (c) 2016-2018 Linaro Limited
*/
-#include <odp_internal.h>
+#include <odp_global_data.h>
+#include <odp_sysinfo_internal.h>
+#include <odp_string_internal.h>
#include <string.h>
-int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
+int _odp_cpuinfo_parser(FILE *file, system_info_t *sysinfo)
{
char str[1024];
char *pos;
@@ -17,8 +17,12 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
int count = 2;
int id = 0;
+ sysinfo->cpu_arch = ODP_CPU_ARCH_PPC;
+ sysinfo->cpu_isa_sw.ppc = ODP_CPU_ARCH_PPC_UNKNOWN;
+ sysinfo->cpu_isa_hw.ppc = ODP_CPU_ARCH_PPC_UNKNOWN;
+
strcpy(sysinfo->cpu_arch_str, "powerpc");
- while (fgets(str, sizeof(str), file) != NULL && id < MAX_CPU_NUMBER) {
+ while (fgets(str, sizeof(str), file) != NULL && id < CONFIG_NUM_CPU_IDS) {
if (!mhz) {
pos = strstr(str, "clock");
@@ -34,13 +38,9 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
pos = strstr(str, "cpu");
if (pos) {
- int len;
-
pos = strchr(str, ':');
- strncpy(sysinfo->model_str[id], pos + 2,
- sizeof(sysinfo->model_str[id]) - 1);
- len = strlen(sysinfo->model_str[id]);
- sysinfo->model_str[id][len - 1] = 0;
+ _odp_strcpy(sysinfo->model_str[id], pos + 2,
+ MODEL_STR_SIZE);
model = 1;
count--;
}
@@ -57,11 +57,11 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
return 0;
}
-uint64_t odp_cpu_hz_current(int id ODP_UNUSED)
+void _odp_sys_info_print_arch(void)
{
- return 0;
}
-void sys_info_print_arch(void)
+uint64_t odp_cpu_arch_hz_current(int id ODP_UNUSED)
{
+ return odp_global_ro.system_info.default_cpu_hz;
}