1
2
3
4
5
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>
12
13 _GLOBAL_TOC(ftrace_caller)
14 lbz r3, PACA_FTRACE_ENABLED(r13)
15 cmpdi r3, 0
16 beqlr
17
18
19 mflr r3
20 ld r11, 0(r1)
21 stdu r1, -112(r1)
22 std r3, 128(r1)
23 ld r4, 16(r11)
24 subi r3, r3, MCOUNT_INSN_SIZE
25 .globl ftrace_call
26 ftrace_call:
27 bl ftrace_stub
28 nop
29 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
30 .globl ftrace_graph_call
31 ftrace_graph_call:
32 b ftrace_graph_stub
33 _GLOBAL(ftrace_graph_stub)
34 #endif
35 ld r0, 128(r1)
36 mtlr r0
37 addi r1, r1, 112
38
39 _GLOBAL(ftrace_stub)
40 blr
41
42 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
43 _GLOBAL(ftrace_graph_caller)
44 addi r5, r1, 112
45
46 ld r4, 128(r1)
47 subi r4, r4, MCOUNT_INSN_SIZE
48
49
50 ld r11, 112(r1)
51 ld r3, 16(r11)
52
53 bl prepare_ftrace_return
54 nop
55
56
57
58
59
60 ld r11, 112(r1)
61 std r3, 16(r11)
62
63 ld r0, 128(r1)
64 mtlr r0
65 addi r1, r1, 112
66 blr
67 #endif