xref: /linux/arch/alpha/include/asm/ftrace.h (revision 59e6295fac26b8e85c1ea859cdd89fa1e47519d7)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_ALPHA_FTRACE_H
3 #define _ASM_ALPHA_FTRACE_H
4 
5 #ifdef CONFIG_FRAME_POINTER
6 
7 static void *alpha_ftrace_return_address0(void)
8 	noinline notrace;
9 static void *alpha_ftrace_return_address0(void)
10 {
11 	return __builtin_return_address(0);
12 }
13 
14 #define ftrace_return_address0 alpha_ftrace_return_address0()
15 
16 /*
17  * __builtin_return_address() requires a constant integer argument.
18  * Keep this as a macro so the value is seen at the callsite.
19  */
20 #define ftrace_return_address(n) __builtin_return_address(n)
21 
22 #else  /* !CONFIG_FRAME_POINTER */
23 
24 #define ftrace_return_address0 0UL
25 #define ftrace_return_address(n) ((void)(n), 0UL)
26 
27 #endif /* CONFIG_FRAME_POINTER */
28 
29 #endif /* _ASM_ALPHA_FTRACE_H */
30