1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Split from ftrace_64.S
6 #include <linux/magic.h>
7 #include <asm/ppc_asm.h>
8 #include <asm/asm-offsets.h>
9 #include <asm/ftrace.h>
10 #include <asm/ppc-opcode.h>
11 #include <asm/export.h>
13 _GLOBAL_TOC(ftrace_caller)
14 lbz r3, PACA_FTRACE_ENABLED(r13)
18 /* Taken from output of objdump from lib64/glibc */
24 subi r3, r3, MCOUNT_INSN_SIZE
29 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
30 .globl ftrace_graph_call
33 _GLOBAL(ftrace_graph_stub)
42 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
43 _GLOBAL(ftrace_graph_caller)
44 /* load r4 with local address */
46 subi r4, r4, MCOUNT_INSN_SIZE
48 /* Grab the LR out of the caller stack frame */
52 bl prepare_ftrace_return
56 * prepare_ftrace_return gives us the address we divert to.
57 * Change the LR in the callers stack frame to this.
66 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */