2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-20 19:23:57 +08:00
linux-next/tools/testing/selftests/vDSO/vdso_config.h
Vincenzo Frascino b2f1c3db28 kselftest: Extend vdso correctness test to clock_gettime64
With the release of Linux 5.1 has been added a new syscall,
clock_gettime64, that provided a 64 bit time value for a specified
clock_ID to make the kernel Y2038 safe on 32 bit architectures.

Extend the vdso correctness test to cover the newly exposed vdso
function.

Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-10-27 17:59:09 -06:00

93 lines
1.9 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* vdso_config.h: Configuration options for vDSO tests.
* Copyright (c) 2019 Arm Ltd.
*/
#ifndef __VDSO_CONFIG_H__
#define __VDSO_CONFIG_H__
/*
* Each architecture exports its vDSO implementation with different names
* and a different version from the others, so we need to handle it as a
* special case.
*/
#if defined(__arm__)
#define VDSO_VERSION 0
#define VDSO_NAMES 1
#define VDSO_32BIT 1
#elif defined(__aarch64__)
#define VDSO_VERSION 3
#define VDSO_NAMES 0
#elif defined(__powerpc__)
#define VDSO_VERSION 1
#define VDSO_NAMES 0
#define VDSO_32BIT 1
#elif defined(__powerpc64__)
#define VDSO_VERSION 1
#define VDSO_NAMES 0
#elif defined (__s390__)
#define VDSO_VERSION 2
#define VDSO_NAMES 0
#define VDSO_32BIT 1
#elif defined (__s390X__)
#define VDSO_VERSION 2
#define VDSO_NAMES 0
#elif defined(__mips__)
#define VDSO_VERSION 0
#define VDSO_NAMES 1
#define VDSO_32BIT 1
#elif defined(__sparc__)
#define VDSO_VERSION 0
#define VDSO_NAMES 1
#define VDSO_32BIT 1
#elif defined(__i386__)
#define VDSO_VERSION 0
#define VDSO_NAMES 1
#define VDSO_32BIT 1
#elif defined(__x86_64__)
#define VDSO_VERSION 0
#define VDSO_NAMES 1
#elif defined(__riscv__)
#define VDSO_VERSION 5
#define VDSO_NAMES 1
#define VDSO_32BIT 1
#else /* nds32 */
#define VDSO_VERSION 4
#define VDSO_NAMES 1
#define VDSO_32BIT 1
#endif
static const char *versions[6] = {
"LINUX_2.6",
"LINUX_2.6.15",
"LINUX_2.6.29",
"LINUX_2.6.39",
"LINUX_4",
"LINUX_4.15",
};
static const char *names[2][6] = {
{
"__kernel_gettimeofday",
"__kernel_clock_gettime",
"__kernel_time",
"__kernel_clock_getres",
"__kernel_getcpu",
#if defined(VDSO_32BIT)
"__kernel_clock_gettime64",
#endif
},
{
"__vdso_gettimeofday",
"__vdso_clock_gettime",
"__vdso_time",
"__vdso_clock_getres",
"__vdso_getcpu",
#if defined(VDSO_32BIT)
"__vdso_clock_gettime64",
#endif
},
};
#endif /* __VDSO_CONFIG_H__ */