xref: /linux/arch/x86/include/asm/vdso.h (revision 1965aae3c98397aad957412413c07e97b1bd4e64)
1*1965aae3SH. Peter Anvin #ifndef _ASM_X86_VDSO_H
2*1965aae3SH. Peter Anvin #define _ASM_X86_VDSO_H
3bb898558SAl Viro 
4bb898558SAl Viro #ifdef CONFIG_X86_64
5bb898558SAl Viro extern const char VDSO64_PRELINK[];
6bb898558SAl Viro 
7bb898558SAl Viro /*
8bb898558SAl Viro  * Given a pointer to the vDSO image, find the pointer to VDSO64_name
9bb898558SAl Viro  * as that symbol is defined in the vDSO sources or linker script.
10bb898558SAl Viro  */
11bb898558SAl Viro #define VDSO64_SYMBOL(base, name)					\
12bb898558SAl Viro ({									\
13bb898558SAl Viro 	extern const char VDSO64_##name[];				\
14bb898558SAl Viro 	(void *)(VDSO64_##name - VDSO64_PRELINK + (unsigned long)(base)); \
15bb898558SAl Viro })
16bb898558SAl Viro #endif
17bb898558SAl Viro 
18bb898558SAl Viro #if defined CONFIG_X86_32 || defined CONFIG_COMPAT
19bb898558SAl Viro extern const char VDSO32_PRELINK[];
20bb898558SAl Viro 
21bb898558SAl Viro /*
22bb898558SAl Viro  * Given a pointer to the vDSO image, find the pointer to VDSO32_name
23bb898558SAl Viro  * as that symbol is defined in the vDSO sources or linker script.
24bb898558SAl Viro  */
25bb898558SAl Viro #define VDSO32_SYMBOL(base, name)					\
26bb898558SAl Viro ({									\
27bb898558SAl Viro 	extern const char VDSO32_##name[];				\
28bb898558SAl Viro 	(void *)(VDSO32_##name - VDSO32_PRELINK + (unsigned long)(base)); \
29bb898558SAl Viro })
30bb898558SAl Viro #endif
31bb898558SAl Viro 
32bb898558SAl Viro /*
33bb898558SAl Viro  * These symbols are defined with the addresses in the vsyscall page.
34bb898558SAl Viro  * See vsyscall-sigreturn.S.
35bb898558SAl Viro  */
36bb898558SAl Viro extern void __user __kernel_sigreturn;
37bb898558SAl Viro extern void __user __kernel_rt_sigreturn;
38bb898558SAl Viro 
39bb898558SAl Viro /*
40bb898558SAl Viro  * These symbols are defined by vdso32.S to mark the bounds
41bb898558SAl Viro  * of the ELF DSO images included therein.
42bb898558SAl Viro  */
43bb898558SAl Viro extern const char vdso32_int80_start, vdso32_int80_end;
44bb898558SAl Viro extern const char vdso32_syscall_start, vdso32_syscall_end;
45bb898558SAl Viro extern const char vdso32_sysenter_start, vdso32_sysenter_end;
46bb898558SAl Viro 
47*1965aae3SH. Peter Anvin #endif /* _ASM_X86_VDSO_H */
48