Skip to contentSkip to conversation

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

PATCH New Jan Kiszka 1 participant 1 message Mar 1, 2019

Subsystems (2)
lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

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

From: Jan Kiszka <[email protected]>

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

---

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(+)
arch/arm/include/asm/arch_timer.h +4 -0
index 9327e3a101dc..e9e7656bc137 100644
@@ -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));
 }
 
Signature · 1 line
2.16.4