1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PPC64_VDSO_H__
3 #define __PPC64_VDSO_H__
4 
5 #ifdef __KERNEL__
6 
7 /* Default link addresses for the vDSOs */
8 #define VDSO32_LBASE	0x0
9 #define VDSO64_LBASE	0x0
10 
11 /* Default map addresses for 32bit vDSO */
12 #define VDSO32_MBASE	0x100000
13 
14 #define VDSO_VERSION_STRING	LINUX_2.6.15
15 
16 /* Define if 64 bits VDSO has procedure descriptors */
17 #undef VDS64_HAS_DESCRIPTORS
18 
19 #ifndef __ASSEMBLY__
20 
21 /* Offsets relative to thread->vdso_base */
22 extern unsigned long vdso64_rt_sigtramp;
23 extern unsigned long vdso32_sigtramp;
24 extern unsigned long vdso32_rt_sigtramp;
25 
26 int vdso_getcpu_init(void);
27 
28 #else /* __ASSEMBLY__ */
29 
30 #ifdef __VDSO64__
31 #ifdef VDS64_HAS_DESCRIPTORS
32 #define V_FUNCTION_BEGIN(name)		\
33 	.globl name;			\
34         .section ".opd","a";		\
35         .align 3;			\
36 	name:				\
37 	.quad .name,.TOC.@tocbase,0;	\
38 	.previous;			\
39 	.globl .name;			\
40 	.type .name,@function; 		\
41 	.name:				\
42 
43 #define V_FUNCTION_END(name)		\
44 	.size .name,.-.name;
45 
46 #define V_LOCAL_FUNC(name) (.name)
47 
48 #else /* VDS64_HAS_DESCRIPTORS */
49 
50 #define V_FUNCTION_BEGIN(name)		\
51 	.globl name;			\
52 	name:				\
53 
54 #define V_FUNCTION_END(name)		\
55 	.size name,.-name;
56 
57 #define V_LOCAL_FUNC(name) (name)
58 
59 #endif /* VDS64_HAS_DESCRIPTORS */
60 #endif /* __VDSO64__ */
61 
62 #ifdef __VDSO32__
63 
64 #define V_FUNCTION_BEGIN(name)		\
65 	.globl name;			\
66 	.type name,@function; 		\
67 	name:				\
68 
69 #define V_FUNCTION_END(name)		\
70 	.size name,.-name;
71 
72 #define V_LOCAL_FUNC(name) (name)
73 
74 #endif /* __VDSO32__ */
75 
76 #endif /* __ASSEMBLY__ */
77 
78 #endif /* __KERNEL__ */
79 
80 #endif /* __PPC64_VDSO_H__ */
81