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 .pushsection ".tramp.ftrace.text","aw",@progbits;
14 .globl ftrace_tramp_text
15 ftrace_tramp_text:
16 .space 64
17 .popsection
18
19 .pushsection ".tramp.ftrace.init","aw",@progbits;
20 .globl ftrace_tramp_init
21 ftrace_tramp_init:
22 .space 64
23 .popsection
24
25 _GLOBAL(mcount)
26 _GLOBAL(_mcount)
27 EXPORT_SYMBOL(_mcount)
28 mflr r12
29 mtctr r12
30 mtlr r0
31 bctr
32
33 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
34 _GLOBAL(return_to_handler)
35
36 std r4, -32(r1)
37 std r3, -24(r1)
38
39 std r2, -16(r1)
40 std r31, -8(r1)
41 mr r31, r1
42 stdu r1, -112(r1)
43
44
45
46
47
48 ld r2, PACATOC(r13)
49
50 bl ftrace_return_to_handler
51 nop
52
53
54 mtlr r3
55
56 ld r1, 0(r1)
57 ld r4, -32(r1)
58 ld r3, -24(r1)
59 ld r2, -16(r1)
60 ld r31, -8(r1)
61
62
63 blr
64 #endif