aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r--arch/powerpc/kernel/entry_64.S58
1 files changed, 55 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 383ed6eb0085..a32699e74c3c 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -931,13 +931,65 @@ _GLOBAL(_mcount)
931 ld r5,0(r5) 931 ld r5,0(r5)
932 mtctr r5 932 mtctr r5
933 bctrl 933 bctrl
934
935 nop 934 nop
935
936
937#ifdef CONFIG_FUNCTION_GRAPH_TRACER
938 b ftrace_graph_caller
939#endif
936 ld r0, 128(r1) 940 ld r0, 128(r1)
937 mtlr r0 941 mtlr r0
938 addi r1, r1, 112 942 addi r1, r1, 112
939_GLOBAL(ftrace_stub) 943_GLOBAL(ftrace_stub)
940 blr 944 blr
941 945
942#endif 946#endif /* CONFIG_DYNAMIC_FTRACE */
943#endif 947
948#ifdef CONFIG_FUNCTION_GRAPH_TRACER
949ftrace_graph_caller:
950 /* load r4 with local address */
951 ld r4, 128(r1)
952 subi r4, r4, MCOUNT_INSN_SIZE
953
954 /* get the parent address */
955 ld r11, 112(r1)
956 addi r3, r11, 16
957
958 bl .prepare_ftrace_return
959 nop
960
961 ld r0, 128(r1)
962 mtlr r0
963 addi r1, r1, 112
964 blr
965
966_GLOBAL(return_to_handler)
967 /* need to save return values */
968 std r4, -32(r1)
969 std r3, -24(r1)
970 /* save TOC */
971 std r2, -16(r1)
972 std r31, -8(r1)
973 mr r31, r1
974 stdu r1, -112(r1)
975
976 /* update the TOC */
977 LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
978 ld r2, 8(r4)
979
980 bl .ftrace_return_to_handler
981 nop
982
983 /* return value has real return address */
984 mtlr r3
985
986 ld r1, 0(r1)
987 ld r4, -32(r1)
988 ld r3, -24(r1)
989 ld r2, -16(r1)
990 ld r31, -8(r1)
991
992 /* Jump back to real return address */
993 blr
994#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
995#endif /* CONFIG_FUNCTION_TRACER */