]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/xray/xray_x86_64.inc
MFV r323917: 8648 Fix range locking in ZIL commit codepath
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / xray / xray_x86_64.inc
1 //===-- xray_x86_64.inc -----------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file is a part of XRay, a dynamic runtime instrumentation system.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include <cstdint>
15 #include <x86intrin.h>
16
17 #include "sanitizer_common/sanitizer_internal_defs.h"
18 #include "xray_defs.h"
19
20 namespace __xray {
21
22 ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
23   unsigned LongCPU;
24   uint64_t TSC = __rdtscp(&LongCPU);
25   CPU = LongCPU;
26   return TSC;
27 }
28
29 uint64_t getTSCFrequency();
30
31 bool probeRequiredCPUFeatures();
32
33 } // namespace __xray