[PATCH] ARM/ARM64: ipipe: Enable access to arch timer from user-space

Jan Kiszka jan.kiszka at siemens.com
Fri Mar 1 13:03:16 CET 2019


From: Jan Kiszka <jan.kiszka at siemens.com>

This allows to expose the timer as clocksource directly to user-space by
memory-mapping its registers.

Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
---

To be applied when splitting b597d0dec360 or after importing the partial
revert of it from noarch.

 arch/arm/include/asm/arch_timer.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h
index 9327e3a101dc..e9e7656bc137 100644
--- a/arch/arm/include/asm/arch_timer.h
+++ b/arch/arm/include/asm/arch_timer.h
@@ -106,6 +106,10 @@ static inline u32 arch_timer_get_cntkctl(void)
 
 static inline void arch_timer_set_cntkctl(u32 cntkctl)
 {
+#ifdef CONFIG_IPIPE
+	/* Enable access to user-space (may not be needed) */
+	cntkctl |= ARCH_TIMER_USR_PCT_ACCESS_EN;
+#endif
 	asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl));
 }
 
-- 
2.16.4



More information about the Xenomai mailing list