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 #ifdef CONFIG_DYNAMIC_FTRACE
18 _GLOBAL_TOC(ftrace_caller)
19 /* Taken from output of objdump from lib64/glibc */
25 subi r3, r3, MCOUNT_INSN_SIZE
30 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
31 .globl ftrace_graph_call
34 _GLOBAL(ftrace_graph_stub)
42 #endif /* CONFIG_DYNAMIC_FTRACE */
44 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
45 _GLOBAL(ftrace_graph_caller)
46 /* load r4 with local address */
48 subi r4, r4, MCOUNT_INSN_SIZE
50 /* Grab the LR out of the caller stack frame */
54 bl prepare_ftrace_return
58 * prepare_ftrace_return gives us the address we divert to.
59 * Change the LR in the callers stack frame to this.
68 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */