xref: /linux/arch/csky/include/asm/vdso.h (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1dd3ef10eSGuo Ren /* SPDX-License-Identifier: GPL-2.0 */
2dd3ef10eSGuo Ren 
3dd3ef10eSGuo Ren #ifndef __ASM_CSKY_VDSO_H
4dd3ef10eSGuo Ren #define __ASM_CSKY_VDSO_H
5dd3ef10eSGuo Ren 
687f3248cSGuo Ren #include <linux/types.h>
7dd3ef10eSGuo Ren 
887f3248cSGuo Ren /*
987f3248cSGuo Ren  * The VDSO symbols are mapped into Linux so we can just use regular symbol
1087f3248cSGuo Ren  * addressing to get their offsets in userspace.  The symbols are mapped at an
1187f3248cSGuo Ren  * offset of 0, but since the linker must support setting weak undefined
1287f3248cSGuo Ren  * symbols to the absolute address 0 it also happens to support other low
1387f3248cSGuo Ren  * addresses even when the code model suggests those low addresses would not
14*0b1f557aSJunlin Yang  * otherwise be available.
1587f3248cSGuo Ren  */
1687f3248cSGuo Ren #define VDSO_SYMBOL(base, name)							\
1787f3248cSGuo Ren ({										\
1887f3248cSGuo Ren 	extern const char __vdso_##name[];					\
1987f3248cSGuo Ren 	(void __user *)((unsigned long)(base) + __vdso_##name);			\
2087f3248cSGuo Ren })
2187f3248cSGuo Ren 
22dd3ef10eSGuo Ren #endif /* __ASM_CSKY_VDSO_H */
23