From: Hongbo Zhang <[email protected]>

Previous odp_cpu_hz() is adapted to return the current frequency,
this patch adds sibling version odp_cpu_hz_id() to return current
frequency of CPU specified by parameter CPU ID.

Signed-off-by: Hongbo Zhang <[email protected]>
---
 include/odp/api/cpu.h                    | 11 +++++++++++
 platform/linux-generic/odp_system_info.c |  5 +++++
 2 files changed, 16 insertions(+)

diff --git a/include/odp/api/cpu.h b/include/odp/api/cpu.h
index 4ec59b4..89d7e42 100644
--- a/include/odp/api/cpu.h
+++ b/include/odp/api/cpu.h
@@ -73,6 +73,17 @@ const char *odp_cpu_model_str_id(int id);
 uint64_t odp_cpu_hz(void);
 
 /**
+ * Current CPU frequency of a CPU (in Hz)
+ *
+ * Returns current frequency of specified CPU
+ *
+ * @param id    CPU ID
+ *
+ * @return CPU frequency in Hz
+ */
+uint64_t odp_cpu_hz_id(int id);
+
+/**
  * Maximum CPU frequency in Hz
  *
  * Returns maximum frequency of this CPU
diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index ed61d36..aa32801 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -425,6 +425,11 @@ uint64_t odp_cpu_hz(void)
        return arch_cpu_hz_current(id);
 }
 
+uint64_t odp_cpu_hz_id(int id)
+{
+       return arch_cpu_hz_current(id);
+}
+
 uint64_t odp_cpu_hz_max(void)
 {
        return odp_cpu_hz_max_id(0);
-- 
1.9.1

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

Reply via email to