]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/compiler-rt/lib/xray/xray_powerpc64.inc
Merge ^/head r357408 through r357661.
[FreeBSD/FreeBSD.git] / contrib / llvm-project / compiler-rt / lib / xray / xray_powerpc64.inc
1 //===-- xray_powerpc64.inc --------------------------------------*- 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 //
9 // This file is a part of XRay, a dynamic runtime instrumentation system.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include <cstdint>
14 #include <mutex>
15 #include <sys/platform/ppc.h>
16
17 #include "xray_defs.h"
18
19 namespace __xray {
20
21 ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
22   CPU = 0;
23   return __ppc_get_timebase();
24 }
25
26 inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
27   static std::mutex M;
28   std::lock_guard<std::mutex> Guard(M);
29   return __ppc_get_timebase_freq();
30 }
31
32 inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT {
33   return true;
34 }
35
36 } // namespace __xray