[PATCH] clocksource/drivers/arm_arch_timer: export arch_timer_get_rate

Chanho Park parkch98 at gmail.com
Mon Jan 11 20:31:40 EST 2021


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 at arm.com>
Cc: Marc Zyngier <maz at kernel.org>
Cc: Daniel Lezcano <daniel.lezcano at linaro.org>
Cc: Thomas Gleixner <tglx at linutronix.de>
Signed-off-by: Chanho Park <chanho61.park at 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




More information about the linux-arm-kernel mailing list