diff mbox

[API,NEXT,v7,13/14] linux-generic: update CPU Hz calling functions

Message ID 1444734798-29063-14-git-send-email-hongbo.zhang@freescale.com
State New
Headers show

Commit Message

hongbo.zhang@freescale.com Oct. 13, 2015, 11:13 a.m. UTC
From: Hongbo Zhang <hongbo.zhang@linaro.org>

The previous odp_sys_cpu_hz() is moved to cpu.h and then renamed to
odp_cpu_hz(), but all the calling function of odp{_sys}_cpu_hz() want to
show maximun CPU capacity in fact, so they should be updated to use the
newly added odp_cpu_hz_max() instead of odp_cpu_hz().
This patch updates the linux-generic platform codes.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
 platform/linux-generic/arch/linux/odp_cpu_cycles.c | 2 +-
 platform/linux-generic/odp_time.c                  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-generic/arch/linux/odp_cpu_cycles.c b/platform/linux-generic/arch/linux/odp_cpu_cycles.c
index b07bfda..0a41727 100644
--- a/platform/linux-generic/arch/linux/odp_cpu_cycles.c
+++ b/platform/linux-generic/arch/linux/odp_cpu_cycles.c
@@ -27,7 +27,7 @@  uint64_t odp_cpu_cycles(void)
 	if (ret != 0)
 		ODP_ABORT("clock_gettime failed\n");
 
-	hz  = odp_cpu_hz();
+	hz  = odp_cpu_hz_max();
 	sec = (uint64_t)time.tv_sec;
 	ns  = (uint64_t)time.tv_nsec;
 
diff --git a/platform/linux-generic/odp_time.c b/platform/linux-generic/odp_time.c
index fde231a..2c532e9 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -28,7 +28,7 @@  uint64_t odp_time_diff_cycles(uint64_t t1, uint64_t t2)
 
 uint64_t odp_time_cycles_to_ns(uint64_t cycles)
 {
-	uint64_t hz = odp_cpu_hz();
+	uint64_t hz = odp_cpu_hz_max();
 
 	if (cycles > (UINT64_MAX / GIGA))
 		return (cycles/hz)*GIGA;
@@ -39,7 +39,7 @@  uint64_t odp_time_cycles_to_ns(uint64_t cycles)
 
 uint64_t odp_time_ns_to_cycles(uint64_t ns)
 {
-	uint64_t hz = odp_cpu_hz();
+	uint64_t hz = odp_cpu_hz_max();
 
 	if (ns > (UINT64_MAX / hz))
 		return (ns/GIGA)*hz;