1 //===---------- RISC-V vdso configuration -------------------------* C++ *-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_RISCV_VDSO_H
9 #define LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_RISCV_VDSO_H
10 #include "src/__support/CPP/string_view.h"
11 #include "src/__support/OSUtil/linux/vdso_sym.h"
12 namespace LIBC_NAMESPACE_DECL
{
14 // translate VDSOSym to symbol names
15 // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/kernel/vdso/vdso.lds.S
16 LIBC_INLINE
constexpr cpp::string_view
symbol_name(VDSOSym sym
) {
18 case VDSOSym::RTSigReturn
:
19 return "__vdso_rt_sigreturn";
20 case VDSOSym::GetTimeOfDay
:
21 return "__vdso_gettimeofday";
22 case VDSOSym::ClockGetTime
:
23 return "__vdso_clock_gettime";
24 case VDSOSym::ClockGetRes
:
25 return "__vdso_clock_getres";
27 return "__vdso_getcpu";
28 case VDSOSym::FlushICache
:
29 return "__vdso_flush_icache";
30 case VDSOSym::RiscvHwProbe
:
31 return "__vdso_riscv_hwprobe";
38 LIBC_INLINE
constexpr cpp::string_view
symbol_version(VDSOSym
) {
42 } // namespace LIBC_NAMESPACE_DECL
43 #endif // LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_RISCV_VDSO_H