summaryrefslogtreecommitdiff
path: root/arch/alpha/include/asm/ftrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/include/asm/ftrace.h')
-rw-r--r--arch/alpha/include/asm/ftrace.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/ftrace.h b/arch/alpha/include/asm/ftrace.h
new file mode 100644
index 000000000..5b75a294a
--- /dev/null
+++ b/arch/alpha/include/asm/ftrace.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_ALPHA_FTRACE_H
+#define _ASM_ALPHA_FTRACE_H
+
+static void *alpha_ftrace_return_address0(void)
+ noinline notrace;
+static void *alpha_ftrace_return_address0(void)
+{
+ return __builtin_return_address(0);
+}
+
+#define ftrace_return_address0 alpha_ftrace_return_address0()
+
+#ifdef CONFIG_FRAME_POINTER
+
+/*
+ * __builtin_return_address() requires a constant integer argument.
+ * Keep this as a macro so the value is seen at the callsite.
+ */
+#define ftrace_return_address(n) __builtin_return_address(n)
+
+#else /* !CONFIG_FRAME_POINTER */
+
+#define ftrace_return_address(n) ((void)(n), 0UL)
+
+#endif /* CONFIG_FRAME_POINTER */
+
+#endif /* _ASM_ALPHA_FTRACE_H */