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