ARM/ARM64: arch_timer: add macros for bits in control register
[deliverable/linux.git] / arch / arm64 / include / asm / arch_timer.h
index c9f1d2816c2bb9086be3b2e001c5d81921a076bf..2b9722f42729e2eaf80d011e59776dc7747f415d 100644 (file)
@@ -96,12 +96,16 @@ static inline void arch_counter_set_user_access(void)
 {
        u32 cntkctl;
 
-       /* Disable user access to the timers and the physical counter. */
        asm volatile("mrs       %0, cntkctl_el1" : "=r" (cntkctl));
-       cntkctl &= ~((3 << 8) | (1 << 0));
 
-       /* Enable user access to the virtual counter and frequency. */
-       cntkctl |= (1 << 1);
+       /* Disable user access to the timers and the physical counter */
+       cntkctl &= ~(ARCH_TIMER_USR_PT_ACCESS_EN
+                       | ARCH_TIMER_USR_VT_ACCESS_EN
+                       | ARCH_TIMER_USR_PCT_ACCESS_EN);
+
+       /* Enable user access to the virtual counter */
+       cntkctl |= ARCH_TIMER_USR_VCT_ACCESS_EN;
+
        asm volatile("msr       cntkctl_el1, %0" : : "r" (cntkctl));
 }
 
This page took 0.023521 seconds and 5 git commands to generate.