Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * vdso_config.h: Configuration options for vDSO tests.
0004  * Copyright (c) 2019 Arm Ltd.
0005  */
0006 #ifndef __VDSO_CONFIG_H__
0007 #define __VDSO_CONFIG_H__
0008 
0009 /*
0010  * Each architecture exports its vDSO implementation with different names
0011  * and a different version from the others, so we need to handle it as a
0012  * special case.
0013  */
0014 #if defined(__arm__)
0015 #define VDSO_VERSION        0
0016 #define VDSO_NAMES      1
0017 #define VDSO_32BIT      1
0018 #elif defined(__aarch64__)
0019 #define VDSO_VERSION        3
0020 #define VDSO_NAMES      0
0021 #elif defined(__powerpc__)
0022 #define VDSO_VERSION        1
0023 #define VDSO_NAMES      0
0024 #define VDSO_32BIT      1
0025 #elif defined(__powerpc64__)
0026 #define VDSO_VERSION        1
0027 #define VDSO_NAMES      0
0028 #elif defined (__s390__)
0029 #define VDSO_VERSION        2
0030 #define VDSO_NAMES      0
0031 #define VDSO_32BIT      1
0032 #elif defined (__s390X__)
0033 #define VDSO_VERSION        2
0034 #define VDSO_NAMES      0
0035 #elif defined(__mips__)
0036 #define VDSO_VERSION        0
0037 #define VDSO_NAMES      1
0038 #define VDSO_32BIT      1
0039 #elif defined(__sparc__)
0040 #define VDSO_VERSION        0
0041 #define VDSO_NAMES      1
0042 #define VDSO_32BIT      1
0043 #elif defined(__i386__)
0044 #define VDSO_VERSION        0
0045 #define VDSO_NAMES      1
0046 #define VDSO_32BIT      1
0047 #elif defined(__x86_64__)
0048 #define VDSO_VERSION        0
0049 #define VDSO_NAMES      1
0050 #elif defined(__riscv__) || defined(__riscv)
0051 #define VDSO_VERSION        5
0052 #define VDSO_NAMES      1
0053 #if __riscv_xlen == 32
0054 #define VDSO_32BIT      1
0055 #endif
0056 #endif
0057 
0058 static const char *versions[6] = {
0059     "LINUX_2.6",
0060     "LINUX_2.6.15",
0061     "LINUX_2.6.29",
0062     "LINUX_2.6.39",
0063     "LINUX_4",
0064     "LINUX_4.15",
0065 };
0066 
0067 static const char *names[2][6] = {
0068     {
0069         "__kernel_gettimeofday",
0070         "__kernel_clock_gettime",
0071         "__kernel_time",
0072         "__kernel_clock_getres",
0073         "__kernel_getcpu",
0074 #if defined(VDSO_32BIT)
0075         "__kernel_clock_gettime64",
0076 #endif
0077     },
0078     {
0079         "__vdso_gettimeofday",
0080         "__vdso_clock_gettime",
0081         "__vdso_time",
0082         "__vdso_clock_getres",
0083         "__vdso_getcpu",
0084 #if defined(VDSO_32BIT)
0085         "__vdso_clock_gettime64",
0086 #endif
0087     },
0088 };
0089 
0090 #endif /* __VDSO_CONFIG_H__ */