mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-27 08:05:27 +08:00
7ac8707479
The x86 vDSO library requires some adaptations to take advantage of the newly introduced generic vDSO library. Introduce the following changes: - Modification of vdso.c to be compliant with the common vdso datapage - Use of lib/vdso for gettimeofday [ tglx: Massaged changelog and cleaned up the function signature formatting ] Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Russell King <linux@armlinux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@mips.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Peter Collingbourne <pcc@google.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Huw Davies <huw@codeweavers.com> Cc: Shijith Thotton <sthotton@marvell.com> Cc: Andre Przywara <andre.przywara@arm.com> Link: https://lkml.kernel.org/r/20190621095252.32307-23-vincenzo.frascino@arm.com
45 lines
1.1 KiB
C
45 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_VDSO_VSYSCALL_H
|
|
#define __ASM_VDSO_VSYSCALL_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <linux/hrtimer.h>
|
|
#include <linux/timekeeper_internal.h>
|
|
#include <vdso/datapage.h>
|
|
#include <asm/vgtod.h>
|
|
#include <asm/vvar.h>
|
|
|
|
int vclocks_used __read_mostly;
|
|
|
|
DEFINE_VVAR(struct vdso_data, _vdso_data);
|
|
/*
|
|
* Update the vDSO data page to keep in sync with kernel timekeeping.
|
|
*/
|
|
static __always_inline
|
|
struct vdso_data *__x86_get_k_vdso_data(void)
|
|
{
|
|
return _vdso_data;
|
|
}
|
|
#define __arch_get_k_vdso_data __x86_get_k_vdso_data
|
|
|
|
static __always_inline
|
|
int __x86_get_clock_mode(struct timekeeper *tk)
|
|
{
|
|
int vclock_mode = tk->tkr_mono.clock->archdata.vclock_mode;
|
|
|
|
/* Mark the new vclock used. */
|
|
BUILD_BUG_ON(VCLOCK_MAX >= 32);
|
|
WRITE_ONCE(vclocks_used, READ_ONCE(vclocks_used) | (1 << vclock_mode));
|
|
|
|
return vclock_mode;
|
|
}
|
|
#define __arch_get_clock_mode __x86_get_clock_mode
|
|
|
|
/* The asm-generic header needs to be included after the definitions above */
|
|
#include <asm-generic/vdso/vsyscall.h>
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
#endif /* __ASM_VDSO_VSYSCALL_H */
|