18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef __ASM_VDSO_VSYSCALL_H 38c2ecf20Sopenharmony_ci#define __ASM_VDSO_VSYSCALL_H 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#ifndef __ASSEMBLY__ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#include <linux/timekeeper_internal.h> 88c2ecf20Sopenharmony_ci#include <vdso/datapage.h> 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#define VDSO_PRECISION_MASK ~(0xFF00ULL<<48) 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ciextern struct vdso_data *vdso_data; 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* 158c2ecf20Sopenharmony_ci * Update the vDSO data page to keep in sync with kernel timekeeping. 168c2ecf20Sopenharmony_ci */ 178c2ecf20Sopenharmony_cistatic __always_inline 188c2ecf20Sopenharmony_cistruct vdso_data *__arm64_get_k_vdso_data(void) 198c2ecf20Sopenharmony_ci{ 208c2ecf20Sopenharmony_ci return vdso_data; 218c2ecf20Sopenharmony_ci} 228c2ecf20Sopenharmony_ci#define __arch_get_k_vdso_data __arm64_get_k_vdso_data 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_cistatic __always_inline 258c2ecf20Sopenharmony_civoid __arm64_update_vsyscall(struct vdso_data *vdata, struct timekeeper *tk) 268c2ecf20Sopenharmony_ci{ 278c2ecf20Sopenharmony_ci vdata[CS_HRES_COARSE].mask = VDSO_PRECISION_MASK; 288c2ecf20Sopenharmony_ci vdata[CS_RAW].mask = VDSO_PRECISION_MASK; 298c2ecf20Sopenharmony_ci} 308c2ecf20Sopenharmony_ci#define __arch_update_vsyscall __arm64_update_vsyscall 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* The asm-generic header needs to be included after the definitions above */ 338c2ecf20Sopenharmony_ci#include <asm-generic/vdso/vsyscall.h> 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#endif /* !__ASSEMBLY__ */ 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci#endif /* __ASM_VDSO_VSYSCALL_H */ 38