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)
45 /* load r4 with local address */
47 subi r4, r4, MCOUNT_INSN_SIZE
49 /* Grab the LR out of the caller stack frame */
53 bl prepare_ftrace_return
57 * prepare_ftrace_return gives us the address we divert to.
58 * Change the LR in the callers stack frame to this.
67 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */