1 //===-- xray_powerpc64.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 <mutex> 16 #include <sys/platform/ppc.h> 17 18 #include "xray_defs.h" 19 20 namespace __xray { 21 22 ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT { 23 CPU = 0; 24 return __ppc_get_timebase(); 25 } 26 27 inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT { 28 static std::mutex M; 29 std::lock_guard<std::mutex> Guard(M); 30 return __ppc_get_timebase_freq(); 31 } 32 33 inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT { 34 return true; 35 } 36 37 } // namespace __xray 38