1693f5ca0SVincenzo Frascino /* SPDX-License-Identifier: GPL-2.0 */ 2693f5ca0SVincenzo Frascino /* 3693f5ca0SVincenzo Frascino * vdso_config.h: Configuration options for vDSO tests. 4693f5ca0SVincenzo Frascino * Copyright (c) 2019 Arm Ltd. 5693f5ca0SVincenzo Frascino */ 6693f5ca0SVincenzo Frascino #ifndef __VDSO_CONFIG_H__ 7693f5ca0SVincenzo Frascino #define __VDSO_CONFIG_H__ 8693f5ca0SVincenzo Frascino 9693f5ca0SVincenzo Frascino /* 10693f5ca0SVincenzo Frascino * Each architecture exports its vDSO implementation with different names 11693f5ca0SVincenzo Frascino * and a different version from the others, so we need to handle it as a 12693f5ca0SVincenzo Frascino * special case. 13693f5ca0SVincenzo Frascino */ 14693f5ca0SVincenzo Frascino #if defined(__arm__) 15693f5ca0SVincenzo Frascino #define VDSO_VERSION 0 16693f5ca0SVincenzo Frascino #define VDSO_NAMES 1 17693f5ca0SVincenzo Frascino #define VDSO_32BIT 1 18693f5ca0SVincenzo Frascino #elif defined(__aarch64__) 19693f5ca0SVincenzo Frascino #define VDSO_VERSION 3 20693f5ca0SVincenzo Frascino #define VDSO_NAMES 0 21d3b90ed9SChristophe Leroy #elif defined(__powerpc64__) 22d3b90ed9SChristophe Leroy #define VDSO_VERSION 1 23d3b90ed9SChristophe Leroy #define VDSO_NAMES 0 24693f5ca0SVincenzo Frascino #elif defined(__powerpc__) 25693f5ca0SVincenzo Frascino #define VDSO_VERSION 1 26693f5ca0SVincenzo Frascino #define VDSO_NAMES 0 27693f5ca0SVincenzo Frascino #define VDSO_32BIT 1 28*2c74d33dSHeiko Carstens #elif defined (__s390__) && !defined(__s390x__) 29693f5ca0SVincenzo Frascino #define VDSO_VERSION 2 30693f5ca0SVincenzo Frascino #define VDSO_NAMES 0 31693f5ca0SVincenzo Frascino #define VDSO_32BIT 1 32*2c74d33dSHeiko Carstens #elif defined (__s390x__) 33693f5ca0SVincenzo Frascino #define VDSO_VERSION 2 34693f5ca0SVincenzo Frascino #define VDSO_NAMES 0 35693f5ca0SVincenzo Frascino #elif defined(__mips__) 36693f5ca0SVincenzo Frascino #define VDSO_VERSION 0 37693f5ca0SVincenzo Frascino #define VDSO_NAMES 1 38693f5ca0SVincenzo Frascino #define VDSO_32BIT 1 39693f5ca0SVincenzo Frascino #elif defined(__sparc__) 40693f5ca0SVincenzo Frascino #define VDSO_VERSION 0 41693f5ca0SVincenzo Frascino #define VDSO_NAMES 1 42693f5ca0SVincenzo Frascino #define VDSO_32BIT 1 43693f5ca0SVincenzo Frascino #elif defined(__i386__) 44693f5ca0SVincenzo Frascino #define VDSO_VERSION 0 45693f5ca0SVincenzo Frascino #define VDSO_NAMES 1 46693f5ca0SVincenzo Frascino #define VDSO_32BIT 1 47693f5ca0SVincenzo Frascino #elif defined(__x86_64__) 48693f5ca0SVincenzo Frascino #define VDSO_VERSION 0 49693f5ca0SVincenzo Frascino #define VDSO_NAMES 1 50f405ac83STobias Klauser #elif defined(__riscv__) || defined(__riscv) 51693f5ca0SVincenzo Frascino #define VDSO_VERSION 5 52693f5ca0SVincenzo Frascino #define VDSO_NAMES 1 53f405ac83STobias Klauser #if __riscv_xlen == 32 54693f5ca0SVincenzo Frascino #define VDSO_32BIT 1 55f405ac83STobias Klauser #endif 56693f5ca0SVincenzo Frascino #endif 57693f5ca0SVincenzo Frascino 58693f5ca0SVincenzo Frascino static const char *versions[6] = { 59693f5ca0SVincenzo Frascino "LINUX_2.6", 60693f5ca0SVincenzo Frascino "LINUX_2.6.15", 61693f5ca0SVincenzo Frascino "LINUX_2.6.29", 62693f5ca0SVincenzo Frascino "LINUX_2.6.39", 63693f5ca0SVincenzo Frascino "LINUX_4", 64693f5ca0SVincenzo Frascino "LINUX_4.15", 65693f5ca0SVincenzo Frascino }; 66693f5ca0SVincenzo Frascino 67b2f1c3dbSVincenzo Frascino static const char *names[2][6] = { 68693f5ca0SVincenzo Frascino { 69693f5ca0SVincenzo Frascino "__kernel_gettimeofday", 70693f5ca0SVincenzo Frascino "__kernel_clock_gettime", 71693f5ca0SVincenzo Frascino "__kernel_time", 72693f5ca0SVincenzo Frascino "__kernel_clock_getres", 73b2f1c3dbSVincenzo Frascino "__kernel_getcpu", 74693f5ca0SVincenzo Frascino #if defined(VDSO_32BIT) 75693f5ca0SVincenzo Frascino "__kernel_clock_gettime64", 76693f5ca0SVincenzo Frascino #endif 77693f5ca0SVincenzo Frascino }, 78693f5ca0SVincenzo Frascino { 79693f5ca0SVincenzo Frascino "__vdso_gettimeofday", 80693f5ca0SVincenzo Frascino "__vdso_clock_gettime", 81693f5ca0SVincenzo Frascino "__vdso_time", 82693f5ca0SVincenzo Frascino "__vdso_clock_getres", 83b2f1c3dbSVincenzo Frascino "__vdso_getcpu", 84693f5ca0SVincenzo Frascino #if defined(VDSO_32BIT) 85693f5ca0SVincenzo Frascino "__vdso_clock_gettime64", 86693f5ca0SVincenzo Frascino #endif 87693f5ca0SVincenzo Frascino }, 88693f5ca0SVincenzo Frascino }; 89693f5ca0SVincenzo Frascino 90693f5ca0SVincenzo Frascino #endif /* __VDSO_CONFIG_H__ */ 91