summaryrefslogtreecommitdiff
path: root/lib/xray/xray_trampoline_powerpc64.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xray/xray_trampoline_powerpc64.cc')
-rw-r--r--lib/xray/xray_trampoline_powerpc64.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/xray/xray_trampoline_powerpc64.cc b/lib/xray/xray_trampoline_powerpc64.cc
new file mode 100644
index 000000000..878c46930
--- /dev/null
+++ b/lib/xray/xray_trampoline_powerpc64.cc
@@ -0,0 +1,15 @@
+#include <atomic>
+#include <xray/xray_interface.h>
+
+namespace __xray {
+
+extern std::atomic<void (*)(int32_t, XRayEntryType)> XRayPatchedFunction;
+
+// Implement this in C++ instead of assembly, to avoid dealing with ToC by hand.
+void CallXRayPatchedFunction(int32_t FuncId, XRayEntryType Type) {
+ auto fptr = __xray::XRayPatchedFunction.load();
+ if (fptr != nullptr)
+ (*fptr)(FuncId, Type);
+}
+
+} // namespace __xray