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