xref: /openbmc/linux/arch/s390/include/asm/vdso.h (revision 75c7b6f3)
1b020632eSMartin Schwidefsky #ifndef __S390_VDSO_H__
2b020632eSMartin Schwidefsky #define __S390_VDSO_H__
3b020632eSMartin Schwidefsky 
4b020632eSMartin Schwidefsky /* Default link addresses for the vDSOs */
5b020632eSMartin Schwidefsky #define VDSO32_LBASE	0
6b020632eSMartin Schwidefsky #define VDSO64_LBASE	0
7b020632eSMartin Schwidefsky 
813c6680aSMartin Schwidefsky #define VDSO_VERSION_STRING	LINUX_2.6.29
9b020632eSMartin Schwidefsky 
10b020632eSMartin Schwidefsky #ifndef __ASSEMBLY__
11b020632eSMartin Schwidefsky 
12b020632eSMartin Schwidefsky /*
13c742b31cSMartin Schwidefsky  * Note about the vdso_data and vdso_per_cpu_data structures:
14b020632eSMartin Schwidefsky  *
15c742b31cSMartin Schwidefsky  * NEVER USE THEM IN USERSPACE CODE DIRECTLY. The layout of the
16b020632eSMartin Schwidefsky  * structure is supposed to be known only to the function in the vdso
17b020632eSMartin Schwidefsky  * itself and may change without notice.
18b020632eSMartin Schwidefsky  */
19b020632eSMartin Schwidefsky 
20b020632eSMartin Schwidefsky struct vdso_data {
21b020632eSMartin Schwidefsky 	__u64 tb_update_count;		/* Timebase atomicity ctr	0x00 */
22b020632eSMartin Schwidefsky 	__u64 xtime_tod_stamp;		/* TOD clock for xtime		0x08 */
23b020632eSMartin Schwidefsky 	__u64 xtime_clock_sec;		/* Kernel time			0x10 */
24b020632eSMartin Schwidefsky 	__u64 xtime_clock_nsec;		/*				0x18 */
25b7eacb59SMartin Schwidefsky 	__u64 xtime_coarse_sec;		/* Coarse kernel time		0x20 */
26b7eacb59SMartin Schwidefsky 	__u64 xtime_coarse_nsec;	/*				0x28 */
27b7eacb59SMartin Schwidefsky 	__u64 wtom_clock_sec;		/* Wall to monotonic clock	0x30 */
28b7eacb59SMartin Schwidefsky 	__u64 wtom_clock_nsec;		/*				0x38 */
29b7eacb59SMartin Schwidefsky 	__u64 wtom_coarse_sec;		/* Coarse wall to monotonic	0x40 */
30b7eacb59SMartin Schwidefsky 	__u64 wtom_coarse_nsec;		/*				0x48 */
31b7eacb59SMartin Schwidefsky 	__u32 tz_minuteswest;		/* Minutes west of Greenwich	0x50 */
32b7eacb59SMartin Schwidefsky 	__u32 tz_dsttime;		/* Type of dst correction	0x54 */
33b7eacb59SMartin Schwidefsky 	__u32 ectg_available;		/* ECTG instruction present	0x58 */
34b7eacb59SMartin Schwidefsky 	__u32 tk_mult;			/* Mult. used for xtime_nsec	0x5c */
35b7eacb59SMartin Schwidefsky 	__u32 tk_shift;			/* Shift used for xtime_nsec	0x60 */
3675c7b6f3SMartin Schwidefsky 	__u32 ts_dir;			/* TOD steering direction	0x64 */
3775c7b6f3SMartin Schwidefsky 	__u64 ts_end;			/* TOD steering end		0x68 */
38c742b31cSMartin Schwidefsky };
39c742b31cSMartin Schwidefsky 
40c742b31cSMartin Schwidefsky struct vdso_per_cpu_data {
41c742b31cSMartin Schwidefsky 	__u64 ectg_timer_base;
42c742b31cSMartin Schwidefsky 	__u64 ectg_user_time;
43249c543bSMartin Schwidefsky 	__u32 cpu_nr;
44249c543bSMartin Schwidefsky 	__u32 node_id;
45b020632eSMartin Schwidefsky };
46b020632eSMartin Schwidefsky 
47b020632eSMartin Schwidefsky extern struct vdso_data *vdso_data;
48b020632eSMartin Schwidefsky 
49c667aeacSHeiko Carstens int vdso_alloc_per_cpu(struct lowcore *lowcore);
50c667aeacSHeiko Carstens void vdso_free_per_cpu(struct lowcore *lowcore);
51c742b31cSMartin Schwidefsky 
52b020632eSMartin Schwidefsky #endif /* __ASSEMBLY__ */
53b020632eSMartin Schwidefsky #endif /* __S390_VDSO_H__ */
54