[PATCH 17/25] cobalt/tick: dovetail: implement pipeline_timer_name()

Jan Kiszka jan.kiszka at siemens.com
Thu May 20 23:44:27 CEST 2021


From: Hongzhan Chen <hongzhan.chen at intel.com>

Get the name of real device controlled by the proxy tick device.

Signed-off-by: Hongzhan Chen <hongzhan.chen at intel.com>
Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
---
 include/cobalt/kernel/dovetail/pipeline/clock.h | 11 +----------
 kernel/cobalt/dovetail/tick.c                   | 12 ++++++++++++
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/include/cobalt/kernel/dovetail/pipeline/clock.h b/include/cobalt/kernel/dovetail/pipeline/clock.h
index d5443a4fd6..82f02d4d77 100644
--- a/include/cobalt/kernel/dovetail/pipeline/clock.h
+++ b/include/cobalt/kernel/dovetail/pipeline/clock.h
@@ -21,16 +21,7 @@ static inline u64 pipeline_read_cycle_counter(void)
 
 void pipeline_set_timer_shot(unsigned long cycles);
 
-static inline const char *pipeline_timer_name(void)
-{
-	/*
-	 * Return the name of the current clock event chip, which is
-	 * the real device controlled by the proxy tick device.
-	 */
-	TODO();
-
-	return "?";
-}
+const char *pipeline_timer_name(void);
 
 static inline const char *pipeline_clock_name(void)
 {
diff --git a/kernel/cobalt/dovetail/tick.c b/kernel/cobalt/dovetail/tick.c
index a6633348b1..41aaa151a8 100644
--- a/kernel/cobalt/dovetail/tick.c
+++ b/kernel/cobalt/dovetail/tick.c
@@ -14,6 +14,18 @@
 
 static DEFINE_PER_CPU(struct clock_proxy_device *, proxy_device);
 
+const char *pipeline_timer_name(void)
+{
+	struct clock_proxy_device *dev = __this_cpu_read(proxy_device);
+	struct clock_event_device *real_dev = dev->real_device;
+
+	/*
+	 * Return the name of the current clock event chip, which is
+	 * the real device controlled by the proxy tick device.
+	 */
+	return real_dev->name;
+}
+
 void pipeline_set_timer_shot(unsigned long delay) /* ns */
 {
 	struct clock_proxy_device *dev = __this_cpu_read(proxy_device);
-- 
2.26.2




More information about the Xenomai mailing list