blob: 29b44a930e71a1c39621acabcc0ba5bda53f7fc7 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __S390_VDSO_H__
3#define __S390_VDSO_H__
4
Olivier Deprez157378f2022-04-04 15:47:50 +02005#include <vdso/datapage.h>
6
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00007/* 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 Scullb4b6d4a2019-01-02 15:54:55 +000023struct vdso_per_cpu_data {
Olivier Deprez157378f2022-04-04 15:47:50 +020024 /*
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 Scullb4b6d4a2019-01-02 15:54:55 +000035};
36
37extern struct vdso_data *vdso_data;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000038
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000039int vdso_alloc_per_cpu(struct lowcore *lowcore);
40void vdso_free_per_cpu(struct lowcore *lowcore);
41
42#endif /* __ASSEMBLY__ */
43#endif /* __S390_VDSO_H__ */