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