summaryrefslogtreecommitdiff
path: root/lib/xray/xray_trampoline_powerpc64.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:52:22 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:52:22 +0000
commit3a1720af1d7f43edc5b214cde0be11bfb94d077e (patch)
tree029e0ff2d5e3c0eaf2405fd8e669555fdf5e1297 /lib/xray/xray_trampoline_powerpc64.cpp
parent8f3cadc28cb2bb9e8f9d69eeaaea1f57f2f7b2ab (diff)
Notes
Diffstat (limited to 'lib/xray/xray_trampoline_powerpc64.cpp')
-rw-r--r--lib/xray/xray_trampoline_powerpc64.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/xray/xray_trampoline_powerpc64.cpp b/lib/xray/xray_trampoline_powerpc64.cpp
new file mode 100644
index 000000000000..878c46930fee
--- /dev/null
+++ b/lib/xray/xray_trampoline_powerpc64.cpp
@@ -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