aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-generic/arch/x86/odp_sysinfo_parse.c')
-rw-r--r--platform/linux-generic/arch/x86/odp_sysinfo_parse.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
index d77165a41..55bbda8c4 100644
--- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
@@ -4,8 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include "config.h"
+
#include <odp_internal.h>
-#include <arch/x86/cpu_flags.h>
+#include <cpu_flags.h>
#include <string.h>
int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
@@ -39,42 +41,6 @@ int cpuinfo_parser(FILE *file, system_info_t *sysinfo)
return 0;
}
-uint64_t odp_cpu_hz_current(int id)
-{
- char str[1024];
- FILE *file;
- int cpu;
- char *pos;
- double mhz = 0.0;
-
- file = fopen("/proc/cpuinfo", "rt");
-
- /* find the correct processor instance */
- while (fgets(str, sizeof(str), file) != NULL) {
- pos = strstr(str, "processor");
- if (pos) {
- if (sscanf(pos, "processor : %d", &cpu) == 1)
- if (cpu == id)
- break;
- }
- }
-
- /* extract the cpu current speed */
- while (fgets(str, sizeof(str), file) != NULL) {
- pos = strstr(str, "cpu MHz");
- if (pos) {
- if (sscanf(pos, "cpu MHz : %lf", &mhz) == 1)
- break;
- }
- }
-
- fclose(file);
- if (mhz)
- return (uint64_t)(mhz * 1000000.0);
-
- return 0;
-}
-
void sys_info_print_arch(void)
{
cpu_flags_print_all();