1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (C) IBM Corporation 2019.
7 #include <sys/platform/ppc.h>
8 #elif RTE_EXEC_ENV_LINUX
13 #include "eal_private.h"
16 get_tsc_freq_arch(void)
19 return __ppc_get_timebase_freq();
20 #elif RTE_EXEC_ENV_LINUX
21 static unsigned long base;
29 f = fopen("/proc/cpuinfo", "rb");
33 while (fgets(buf, sizeof(buf), f) != NULL) {
34 char *ret = strstr(buf, "timebase");
38 ret += sizeof("timebase") - 1;
39 ret = strchr(ret, ':');
42 base = strtoul(ret + 1, NULL, 10);
47 return (uint64_t) base;