1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_VDSO_VSYSCALL_H
3 #define __ASM_VDSO_VSYSCALL_H
7 #include <linux/timekeeper_internal.h>
8 #include <vdso/datapage.h>
9 #include <asm/cacheflush.h>
11 extern struct vdso_data
*vdso_data
;
12 extern bool cntvct_ok
;
14 static __always_inline
15 bool tk_is_cntvct(const struct timekeeper
*tk
)
17 if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER
))
20 if (!tk
->tkr_mono
.clock
->archdata
.vdso_direct
)
27 * Update the vDSO data page to keep in sync with kernel timekeeping.
29 static __always_inline
30 struct vdso_data
*__arm_get_k_vdso_data(void)
34 #define __arch_get_k_vdso_data __arm_get_k_vdso_data
36 static __always_inline
37 bool __arm_update_vdso_data(void)
41 #define __arch_update_vdso_data __arm_update_vdso_data
43 static __always_inline
44 int __arm_get_clock_mode(struct timekeeper
*tk
)
46 u32 __tk_is_cntvct
= tk_is_cntvct(tk
);
48 return __tk_is_cntvct
;
50 #define __arch_get_clock_mode __arm_get_clock_mode
52 static __always_inline
53 int __arm_use_vsyscall(struct vdso_data
*vdata
)
55 return vdata
[CS_HRES_COARSE
].clock_mode
;
57 #define __arch_use_vsyscall __arm_use_vsyscall
59 static __always_inline
60 void __arm_sync_vdso_data(struct vdso_data
*vdata
)
62 flush_dcache_page(virt_to_page(vdata
));
64 #define __arch_sync_vdso_data __arm_sync_vdso_data
66 /* The asm-generic header needs to be included after the definitions above */
67 #include <asm-generic/vdso/vsyscall.h>
69 #endif /* !__ASSEMBLY__ */
71 #endif /* __ASM_VDSO_VSYSCALL_H */