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