162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * vdso_config.h: Configuration options for vDSO tests.
462306a36Sopenharmony_ci * Copyright (c) 2019 Arm Ltd.
562306a36Sopenharmony_ci */
662306a36Sopenharmony_ci#ifndef __VDSO_CONFIG_H__
762306a36Sopenharmony_ci#define __VDSO_CONFIG_H__
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci/*
1062306a36Sopenharmony_ci * Each architecture exports its vDSO implementation with different names
1162306a36Sopenharmony_ci * and a different version from the others, so we need to handle it as a
1262306a36Sopenharmony_ci * special case.
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci#if defined(__arm__)
1562306a36Sopenharmony_ci#define VDSO_VERSION		0
1662306a36Sopenharmony_ci#define VDSO_NAMES		1
1762306a36Sopenharmony_ci#define VDSO_32BIT		1
1862306a36Sopenharmony_ci#elif defined(__aarch64__)
1962306a36Sopenharmony_ci#define VDSO_VERSION		3
2062306a36Sopenharmony_ci#define VDSO_NAMES		0
2162306a36Sopenharmony_ci#elif defined(__powerpc__)
2262306a36Sopenharmony_ci#define VDSO_VERSION		1
2362306a36Sopenharmony_ci#define VDSO_NAMES		0
2462306a36Sopenharmony_ci#define VDSO_32BIT		1
2562306a36Sopenharmony_ci#elif defined(__powerpc64__)
2662306a36Sopenharmony_ci#define VDSO_VERSION		1
2762306a36Sopenharmony_ci#define VDSO_NAMES		0
2862306a36Sopenharmony_ci#elif defined (__s390__)
2962306a36Sopenharmony_ci#define VDSO_VERSION		2
3062306a36Sopenharmony_ci#define VDSO_NAMES		0
3162306a36Sopenharmony_ci#define VDSO_32BIT		1
3262306a36Sopenharmony_ci#elif defined (__s390X__)
3362306a36Sopenharmony_ci#define VDSO_VERSION		2
3462306a36Sopenharmony_ci#define VDSO_NAMES		0
3562306a36Sopenharmony_ci#elif defined(__mips__)
3662306a36Sopenharmony_ci#define VDSO_VERSION		0
3762306a36Sopenharmony_ci#define VDSO_NAMES		1
3862306a36Sopenharmony_ci#define VDSO_32BIT		1
3962306a36Sopenharmony_ci#elif defined(__sparc__)
4062306a36Sopenharmony_ci#define VDSO_VERSION		0
4162306a36Sopenharmony_ci#define VDSO_NAMES		1
4262306a36Sopenharmony_ci#define VDSO_32BIT		1
4362306a36Sopenharmony_ci#elif defined(__i386__)
4462306a36Sopenharmony_ci#define VDSO_VERSION		0
4562306a36Sopenharmony_ci#define VDSO_NAMES		1
4662306a36Sopenharmony_ci#define VDSO_32BIT		1
4762306a36Sopenharmony_ci#elif defined(__x86_64__)
4862306a36Sopenharmony_ci#define VDSO_VERSION		0
4962306a36Sopenharmony_ci#define VDSO_NAMES		1
5062306a36Sopenharmony_ci#elif defined(__riscv__) || defined(__riscv)
5162306a36Sopenharmony_ci#define VDSO_VERSION		5
5262306a36Sopenharmony_ci#define VDSO_NAMES		1
5362306a36Sopenharmony_ci#if __riscv_xlen == 32
5462306a36Sopenharmony_ci#define VDSO_32BIT		1
5562306a36Sopenharmony_ci#endif
5662306a36Sopenharmony_ci#endif
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_cistatic const char *versions[6] = {
5962306a36Sopenharmony_ci	"LINUX_2.6",
6062306a36Sopenharmony_ci	"LINUX_2.6.15",
6162306a36Sopenharmony_ci	"LINUX_2.6.29",
6262306a36Sopenharmony_ci	"LINUX_2.6.39",
6362306a36Sopenharmony_ci	"LINUX_4",
6462306a36Sopenharmony_ci	"LINUX_4.15",
6562306a36Sopenharmony_ci};
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_cistatic const char *names[2][6] = {
6862306a36Sopenharmony_ci	{
6962306a36Sopenharmony_ci		"__kernel_gettimeofday",
7062306a36Sopenharmony_ci		"__kernel_clock_gettime",
7162306a36Sopenharmony_ci		"__kernel_time",
7262306a36Sopenharmony_ci		"__kernel_clock_getres",
7362306a36Sopenharmony_ci		"__kernel_getcpu",
7462306a36Sopenharmony_ci#if defined(VDSO_32BIT)
7562306a36Sopenharmony_ci		"__kernel_clock_gettime64",
7662306a36Sopenharmony_ci#endif
7762306a36Sopenharmony_ci	},
7862306a36Sopenharmony_ci	{
7962306a36Sopenharmony_ci		"__vdso_gettimeofday",
8062306a36Sopenharmony_ci		"__vdso_clock_gettime",
8162306a36Sopenharmony_ci		"__vdso_time",
8262306a36Sopenharmony_ci		"__vdso_clock_getres",
8362306a36Sopenharmony_ci		"__vdso_getcpu",
8462306a36Sopenharmony_ci#if defined(VDSO_32BIT)
8562306a36Sopenharmony_ci		"__vdso_clock_gettime64",
8662306a36Sopenharmony_ci#endif
8762306a36Sopenharmony_ci	},
8862306a36Sopenharmony_ci};
8962306a36Sopenharmony_ci
9062306a36Sopenharmony_ci#endif /* __VDSO_CONFIG_H__ */
91