From: Hongbo Zhang <[email protected]>

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 <[email protected]>
---
 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 --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;
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to