Hook up the generic vDSO implementation to the LoongArch vDSO data page by providing the required __arch_chacha20_blocks_nostack, __arch_get_k_vdso_rng_data, and getrandom_syscall implementations. Also wire up the selftests. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Acked-by: Huacai Chen <chenhuacai@kernel.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
35 lines
864 B
C
35 lines
864 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_VDSO_VSYSCALL_H
|
|
#define __ASM_VDSO_VSYSCALL_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <linux/timekeeper_internal.h>
|
|
#include <vdso/datapage.h>
|
|
|
|
extern struct vdso_data *vdso_data;
|
|
extern struct vdso_rng_data *vdso_rng_data;
|
|
|
|
/*
|
|
* Update the vDSO data page to keep in sync with kernel timekeeping.
|
|
*/
|
|
static __always_inline
|
|
struct vdso_data *__loongarch_get_k_vdso_data(void)
|
|
{
|
|
return vdso_data;
|
|
}
|
|
#define __arch_get_k_vdso_data __loongarch_get_k_vdso_data
|
|
|
|
static __always_inline
|
|
struct vdso_rng_data *__loongarch_get_k_vdso_rng_data(void)
|
|
{
|
|
return vdso_rng_data;
|
|
}
|
|
#define __arch_get_k_vdso_rng_data __loongarch_get_k_vdso_rng_data
|
|
|
|
/* 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 */
|