2 * Split from ftrace_64.S
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
10 #include <linux/magic.h>
11 #include <asm/ppc_asm.h>
12 #include <asm/asm-offsets.h>
13 #include <asm/ftrace.h>
14 #include <asm/ppc-opcode.h>
15 #include <asm/export.h>
17 _GLOBAL_TOC(ftrace_caller)
18 lbz r3, PACA_FTRACE_ENABLED(r13)
22 /* Taken from output of objdump from lib64/glibc */
28 subi r3, r3, MCOUNT_INSN_SIZE
33 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
34 .globl ftrace_graph_call
37 _GLOBAL(ftrace_graph_stub)
46 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
47 _GLOBAL(ftrace_graph_caller)
48 /* load r4 with local address */
50 subi r4, r4, MCOUNT_INSN_SIZE
52 /* Grab the LR out of the caller stack frame */
56 bl prepare_ftrace_return
60 * prepare_ftrace_return gives us the address we divert to.
61 * Change the LR in the callers stack frame to this.
70 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */