treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / x86 / include / asm / vdso / vsyscall.h
blob0026ab2123ce96756114a897439a3966f4755416
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_VDSO_VSYSCALL_H
3 #define __ASM_VDSO_VSYSCALL_H
5 #ifndef __ASSEMBLY__
7 #include <linux/hrtimer.h>
8 #include <linux/timekeeper_internal.h>
9 #include <vdso/datapage.h>
10 #include <asm/vgtod.h>
11 #include <asm/vvar.h>
13 int vclocks_used __read_mostly;
15 DEFINE_VVAR(struct vdso_data, _vdso_data);
17 * Update the vDSO data page to keep in sync with kernel timekeeping.
19 static __always_inline
20 struct vdso_data *__x86_get_k_vdso_data(void)
22 return _vdso_data;
24 #define __arch_get_k_vdso_data __x86_get_k_vdso_data
26 static __always_inline
27 int __x86_get_clock_mode(struct timekeeper *tk)
29 int vclock_mode = tk->tkr_mono.clock->archdata.vclock_mode;
31 /* Mark the new vclock used. */
32 BUILD_BUG_ON(VCLOCK_MAX >= 32);
33 WRITE_ONCE(vclocks_used, READ_ONCE(vclocks_used) | (1 << vclock_mode));
35 return vclock_mode;
37 #define __arch_get_clock_mode __x86_get_clock_mode
39 /* The asm-generic header needs to be included after the definitions above */
40 #include <asm-generic/vdso/vsyscall.h>
42 #endif /* !__ASSEMBLY__ */
44 #endif /* __ASM_VDSO_VSYSCALL_H */