linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocksource/drivers/arm_arch_timer: export arch_timer_get_rate
@ 2021-01-12  1:31 Chanho Park
  2021-01-12 10:12 ` Mark Rutland
  0 siblings, 1 reply; 8+ messages in thread
From: Chanho Park @ 2021-01-12  1:31 UTC (permalink / raw)
  To: mark.rutland, maz
  Cc: Chanho Park, Daniel Lezcano, Thomas Gleixner, linux-arm-kernel

This patch adds to export arch_timer_get_rate function for calculating
absolute timestamp which is based on arch timer like below.
arch_timer_read_counter was already exported but arch_timer_get_rate
wasn't. Thus, this patch tries to export this to use this function from
loadable kernel module.

u32 rate = arch_timer_get_rate() / (1000 * 1000);
u64 abs_ns = arch_timer_read_counter() * 1000 / rate;

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
---
 drivers/clocksource/arm_arch_timer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index d0177824c518..f3f49d96dbe9 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -961,6 +961,7 @@ u32 arch_timer_get_rate(void)
 {
 	return arch_timer_rate;
 }
+EXPORT_SYMBOL_GPL(arch_timer_get_rate);
 
 bool arch_timer_evtstrm_available(void)
 {
-- 
2.23.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-01-13 10:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-12  1:31 [PATCH] clocksource/drivers/arm_arch_timer: export arch_timer_get_rate Chanho Park
2021-01-12 10:12 ` Mark Rutland
2021-01-12 13:39   ` Chanho Park
2021-01-12 14:45     ` Marc Zyngier
2021-01-12 15:14       ` Chanho Park
2021-01-12 15:30         ` Marc Zyngier
2021-01-13  9:56           ` Chanho Park
2021-01-13 10:06             ` Marc Zyngier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).