mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-03 17:51:23 +00:00

Not all users of this header make use of all its variables. For example vdso_test_correctness.c does not use "versions": In file included from vdso_test_correctness.c:22: vdso_config.h:61:20: warning: ‘versions’ defined but not used [-Wunused-variable] 61 | static const char *versions[7] = { | ^~~~~~~~ Avoid those warnings through attribute((unused)). Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Link: https://lore.kernel.org/all/20250611-selftests-vdso-fixes-v3-5-e62e37a6bcf5@linutronix.de
95 lines
2.0 KiB
C
95 lines
2.0 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(__powerpc64__)
|
|
#define VDSO_VERSION 1
|
|
#define VDSO_NAMES 0
|
|
#elif defined(__powerpc__)
|
|
#define VDSO_VERSION 1
|
|
#define VDSO_NAMES 0
|
|
#define VDSO_32BIT 1
|
|
#elif defined (__s390__) && !defined(__s390x__)
|
|
#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__) || defined(__riscv)
|
|
#define VDSO_VERSION 5
|
|
#define VDSO_NAMES 1
|
|
#if __riscv_xlen == 32
|
|
#define VDSO_32BIT 1
|
|
#endif
|
|
#elif defined(__loongarch__)
|
|
#define VDSO_VERSION 6
|
|
#define VDSO_NAMES 1
|
|
#endif
|
|
|
|
__attribute__((unused))
|
|
static const char *versions[7] = {
|
|
"LINUX_2.6",
|
|
"LINUX_2.6.15",
|
|
"LINUX_2.6.29",
|
|
"LINUX_2.6.39",
|
|
"LINUX_4",
|
|
"LINUX_4.15",
|
|
"LINUX_5.10"
|
|
};
|
|
|
|
__attribute__((unused))
|
|
static const char *names[2][7] = {
|
|
{
|
|
"__kernel_gettimeofday",
|
|
"__kernel_clock_gettime",
|
|
"__kernel_time",
|
|
"__kernel_clock_getres",
|
|
"__kernel_getcpu",
|
|
"__kernel_clock_gettime64",
|
|
"__kernel_getrandom",
|
|
},
|
|
{
|
|
"__vdso_gettimeofday",
|
|
"__vdso_clock_gettime",
|
|
"__vdso_time",
|
|
"__vdso_clock_getres",
|
|
"__vdso_getcpu",
|
|
"__vdso_clock_gettime64",
|
|
"__vdso_getrandom",
|
|
},
|
|
};
|
|
|
|
#endif /* __VDSO_CONFIG_H__ */
|