brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 24ddb25 Raw
44 lines · c
1//===---------- RISC-V 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-exception6//7//===----------------------------------------------------------------------===//8#ifndef LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_RISCV_VDSO_H9#define LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_RISCV_VDSO_H10#include "src/__support/CPP/string_view.h"11#include "src/__support/OSUtil/linux/vdso_sym.h"12namespace LIBC_NAMESPACE_DECL {13namespace vdso {14// translate VDSOSym to symbol names15// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/kernel/vdso/vdso.lds.S16LIBC_INLINE constexpr cpp::string_view symbol_name(VDSOSym sym) {17  switch (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";26  case VDSOSym::GetCpu:27    return "__vdso_getcpu";28  case VDSOSym::FlushICache:29    return "__vdso_flush_icache";30  case VDSOSym::RiscvHwProbe:31    return "__vdso_riscv_hwprobe";32  default:33    return "";34  }35}36 37// symbol versions38LIBC_INLINE constexpr cpp::string_view symbol_version(VDSOSym) {39  return "LINUX_4.15";40}41} // namespace vdso42} // namespace LIBC_NAMESPACE_DECL43#endif // LLVM_LIBC_SRC___SUPPORT_OSUTIL_LINUX_RISCV_VDSO_H44