162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci#ifndef __ASM_CSKY_VDSO_H
462306a36Sopenharmony_ci#define __ASM_CSKY_VDSO_H
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#include <linux/types.h>
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#ifndef GENERIC_TIME_VSYSCALL
962306a36Sopenharmony_cistruct vdso_data {
1062306a36Sopenharmony_ci};
1162306a36Sopenharmony_ci#endif
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci/*
1462306a36Sopenharmony_ci * The VDSO symbols are mapped into Linux so we can just use regular symbol
1562306a36Sopenharmony_ci * addressing to get their offsets in userspace.  The symbols are mapped at an
1662306a36Sopenharmony_ci * offset of 0, but since the linker must support setting weak undefined
1762306a36Sopenharmony_ci * symbols to the absolute address 0 it also happens to support other low
1862306a36Sopenharmony_ci * addresses even when the code model suggests those low addresses would not
1962306a36Sopenharmony_ci * otherwise be available.
2062306a36Sopenharmony_ci */
2162306a36Sopenharmony_ci#define VDSO_SYMBOL(base, name)							\
2262306a36Sopenharmony_ci({										\
2362306a36Sopenharmony_ci	extern const char __vdso_##name[];					\
2462306a36Sopenharmony_ci	(void __user *)((unsigned long)(base) + __vdso_##name);			\
2562306a36Sopenharmony_ci})
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#endif /* __ASM_CSKY_VDSO_H */
28