xref: /OK3568_Linux_fs/kernel/arch/s390/include/asm/vdso.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef __S390_VDSO_H__
3*4882a593Smuzhiyun #define __S390_VDSO_H__
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #include <vdso/datapage.h>
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun /* Default link addresses for the vDSOs */
8*4882a593Smuzhiyun #define VDSO32_LBASE	0
9*4882a593Smuzhiyun #define VDSO64_LBASE	0
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #define VDSO_VERSION_STRING	LINUX_2.6.29
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #ifndef __ASSEMBLY__
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun /*
16*4882a593Smuzhiyun  * Note about the vdso_data and vdso_per_cpu_data structures:
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  * NEVER USE THEM IN USERSPACE CODE DIRECTLY. The layout of the
19*4882a593Smuzhiyun  * structure is supposed to be known only to the function in the vdso
20*4882a593Smuzhiyun  * itself and may change without notice.
21*4882a593Smuzhiyun  */
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun struct vdso_per_cpu_data {
24*4882a593Smuzhiyun 	/*
25*4882a593Smuzhiyun 	 * Note: node_id and cpu_nr must be at adjacent memory locations.
26*4882a593Smuzhiyun 	 * VDSO userspace must read both values with a single instruction.
27*4882a593Smuzhiyun 	 */
28*4882a593Smuzhiyun 	union {
29*4882a593Smuzhiyun 		__u64 getcpu_val;
30*4882a593Smuzhiyun 		struct {
31*4882a593Smuzhiyun 			__u32 node_id;
32*4882a593Smuzhiyun 			__u32 cpu_nr;
33*4882a593Smuzhiyun 		};
34*4882a593Smuzhiyun 	};
35*4882a593Smuzhiyun };
36*4882a593Smuzhiyun 
37*4882a593Smuzhiyun extern struct vdso_data *vdso_data;
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun int vdso_alloc_per_cpu(struct lowcore *lowcore);
40*4882a593Smuzhiyun void vdso_free_per_cpu(struct lowcore *lowcore);
41*4882a593Smuzhiyun 
42*4882a593Smuzhiyun #endif /* __ASSEMBLY__ */
43*4882a593Smuzhiyun #endif /* __S390_VDSO_H__ */
44