xref: /aosp_15_r20/external/llvm-libc/src/__support/OSUtil/linux/arm/vdso.h (revision 71db0c75aadcf003ffe3238005f61d7618a3fead)
1 //===---------- arm vdso configuration ----------------------------* C++ *-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_ARM_VDSO_H
9 #define LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_ARM_VDSO_H
10 #include "src/__support/CPP/string_view.h"
11 #include "src/__support/OSUtil/linux/vdso_sym.h"
12 namespace LIBC_NAMESPACE_DECL {
13 namespace vdso {
14 // translate VDSOSym to symbol names
15 // https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/vdso/vdso.lds.S
symbol_name(VDSOSym sym)16 LIBC_INLINE constexpr cpp::string_view symbol_name(VDSOSym sym) {
17   switch (sym) {
18   case VDSOSym::ClockGetTime:
19     return "__vdso_clock_gettime";
20   case VDSOSym::GetTimeOfDay:
21     return "__vdso_gettimeofday";
22   case VDSOSym::ClockGetRes:
23     return "__vdso_clock_getres";
24   case VDSOSym::ClockGetTime64:
25     return "__vdso_clock_gettime64";
26   default:
27     return "";
28   }
29 }
30 
31 // symbol versions
symbol_version(VDSOSym)32 LIBC_INLINE constexpr cpp::string_view symbol_version(VDSOSym) {
33   return "LINUX_2.6";
34 }
35 } // namespace vdso
36 } // namespace LIBC_NAMESPACE_DECL
37 #endif // LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_ARM_VDSO_H
38