xref: /linux/arch/arm/include/asm/vdso/vsyscall.h (revision ead5d1f4d877e92c051e1a1ade623d0d30e71619)
1*20e2fc42SVincenzo Frascino /* SPDX-License-Identifier: GPL-2.0 */
2*20e2fc42SVincenzo Frascino #ifndef __ASM_VDSO_VSYSCALL_H
3*20e2fc42SVincenzo Frascino #define __ASM_VDSO_VSYSCALL_H
4*20e2fc42SVincenzo Frascino 
5*20e2fc42SVincenzo Frascino #ifndef __ASSEMBLY__
6*20e2fc42SVincenzo Frascino 
7*20e2fc42SVincenzo Frascino #include <linux/timekeeper_internal.h>
8*20e2fc42SVincenzo Frascino #include <vdso/datapage.h>
9*20e2fc42SVincenzo Frascino #include <asm/cacheflush.h>
10*20e2fc42SVincenzo Frascino 
11*20e2fc42SVincenzo Frascino extern struct vdso_data *vdso_data;
12*20e2fc42SVincenzo Frascino extern bool cntvct_ok;
13*20e2fc42SVincenzo Frascino 
14*20e2fc42SVincenzo Frascino /*
15*20e2fc42SVincenzo Frascino  * Update the vDSO data page to keep in sync with kernel timekeeping.
16*20e2fc42SVincenzo Frascino  */
17*20e2fc42SVincenzo Frascino static __always_inline
__arm_get_k_vdso_data(void)18*20e2fc42SVincenzo Frascino struct vdso_data *__arm_get_k_vdso_data(void)
19*20e2fc42SVincenzo Frascino {
20*20e2fc42SVincenzo Frascino 	return vdso_data;
21*20e2fc42SVincenzo Frascino }
22*20e2fc42SVincenzo Frascino #define __arch_get_k_vdso_data __arm_get_k_vdso_data
23*20e2fc42SVincenzo Frascino 
24*20e2fc42SVincenzo Frascino static __always_inline
__arm_sync_vdso_data(struct vdso_data * vdata)25*20e2fc42SVincenzo Frascino void __arm_sync_vdso_data(struct vdso_data *vdata)
26*20e2fc42SVincenzo Frascino {
27*20e2fc42SVincenzo Frascino 	flush_dcache_page(virt_to_page(vdata));
28*20e2fc42SVincenzo Frascino }
29*20e2fc42SVincenzo Frascino #define __arch_sync_vdso_data __arm_sync_vdso_data
30*20e2fc42SVincenzo Frascino 
31*20e2fc42SVincenzo Frascino /* The asm-generic header needs to be included after the definitions above */
32*20e2fc42SVincenzo Frascino #include <asm-generic/vdso/vsyscall.h>
33*20e2fc42SVincenzo Frascino 
34*20e2fc42SVincenzo Frascino #endif /* !__ASSEMBLY__ */
35*20e2fc42SVincenzo Frascino 
36*20e2fc42SVincenzo Frascino #endif /* __ASM_VDSO_VSYSCALL_H */
37