aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_64.S
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-04-06 03:02:57 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-06 03:02:57 -0400
commitf541ae326fa120fa5c57433e4d9a133df212ce41 (patch)
treebdbd94ec72cfc601118051cb35e8617d55510177 /arch/powerpc/kernel/entry_64.S
parente255357764f92afcafafbd4879b222b8c752065a (diff)
parent0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff)
Merge branch 'linus' into perfcounters/core-v2
Merge reason: we have gathered quite a few conflicts, need to merge upstream Conflicts: arch/powerpc/kernel/Makefile arch/x86/ia32/ia32entry.S arch/x86/include/asm/hardirq.h arch/x86/include/asm/unistd_32.h arch/x86/include/asm/unistd_64.h arch/x86/kernel/cpu/common.c arch/x86/kernel/irq.c arch/x86/kernel/syscall_table_32.S arch/x86/mm/iomap_32.c include/linux/sched.h kernel/Makefile Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r--arch/powerpc/kernel/entry_64.S89
1 files changed, 86 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index f30b4e553c53..43e073477c34 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -917,6 +917,12 @@ _GLOBAL(ftrace_caller)
917ftrace_call: 917ftrace_call:
918 bl ftrace_stub 918 bl ftrace_stub
919 nop 919 nop
920#ifdef CONFIG_FUNCTION_GRAPH_TRACER
921.globl ftrace_graph_call
922ftrace_graph_call:
923 b ftrace_graph_stub
924_GLOBAL(ftrace_graph_stub)
925#endif
920 ld r0, 128(r1) 926 ld r0, 128(r1)
921 mtlr r0 927 mtlr r0
922 addi r1, r1, 112 928 addi r1, r1, 112
@@ -940,13 +946,90 @@ _GLOBAL(_mcount)
940 ld r5,0(r5) 946 ld r5,0(r5)
941 mtctr r5 947 mtctr r5
942 bctrl 948 bctrl
943
944 nop 949 nop
950
951
952#ifdef CONFIG_FUNCTION_GRAPH_TRACER
953 b ftrace_graph_caller
954#endif
945 ld r0, 128(r1) 955 ld r0, 128(r1)
946 mtlr r0 956 mtlr r0
947 addi r1, r1, 112 957 addi r1, r1, 112
948_GLOBAL(ftrace_stub) 958_GLOBAL(ftrace_stub)
949 blr 959 blr
950 960
951#endif 961#endif /* CONFIG_DYNAMIC_FTRACE */
952#endif 962
963#ifdef CONFIG_FUNCTION_GRAPH_TRACER
964_GLOBAL(ftrace_graph_caller)
965 /* load r4 with local address */
966 ld r4, 128(r1)
967 subi r4, r4, MCOUNT_INSN_SIZE
968
969 /* get the parent address */
970 ld r11, 112(r1)
971 addi r3, r11, 16
972
973 bl .prepare_ftrace_return
974 nop
975
976 ld r0, 128(r1)
977 mtlr r0
978 addi r1, r1, 112
979 blr
980
981_GLOBAL(return_to_handler)
982 /* need to save return values */
983 std r4, -24(r1)
984 std r3, -16(r1)
985 std r31, -8(r1)
986 mr r31, r1
987 stdu r1, -112(r1)
988
989 bl .ftrace_return_to_handler
990 nop
991
992 /* return value has real return address */
993 mtlr r3
994
995 ld r1, 0(r1)
996 ld r4, -24(r1)
997 ld r3, -16(r1)
998 ld r31, -8(r1)
999
1000 /* Jump back to real return address */
1001 blr
1002
1003_GLOBAL(mod_return_to_handler)
1004 /* need to save return values */
1005 std r4, -32(r1)
1006 std r3, -24(r1)
1007 /* save TOC */
1008 std r2, -16(r1)
1009 std r31, -8(r1)
1010 mr r31, r1
1011 stdu r1, -112(r1)
1012
1013 /*
1014 * We are in a module using the module's TOC.
1015 * Switch to our TOC to run inside the core kernel.
1016 */
1017 LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
1018 ld r2, 8(r4)
1019
1020 bl .ftrace_return_to_handler
1021 nop
1022
1023 /* return value has real return address */
1024 mtlr r3
1025
1026 ld r1, 0(r1)
1027 ld r4, -32(r1)
1028 ld r3, -24(r1)
1029 ld r2, -16(r1)
1030 ld r31, -8(r1)
1031
1032 /* Jump back to real return address */
1033 blr
1034#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
1035#endif /* CONFIG_FUNCTION_TRACER */