diff mbox

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

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

Commit Message

hongbo.zhang@freescale.com Sept. 17, 2015, 1:10 p.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_time_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_time_cycles.c b/platform/linux-generic/arch/linux/odp_time_cycles.c
index 035afdf..a4ade61 100644
--- a/platform/linux-generic/arch/linux/odp_time_cycles.c
+++ b/platform/linux-generic/arch/linux/odp_time_cycles.c
@@ -27,7 +27,7 @@  uint64_t odp_time_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 11e852a..162b4cb 100644
--- a/platform/linux-generic/odp_time.c
+++ b/platform/linux-generic/odp_time.c
@@ -22,7 +22,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;
@@ -33,7 +33,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;