diff options
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index c0db5b769e55..2c4d9e056ead 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -870,3 +870,65 @@ _GLOBAL(enter_prom) | |||
870 | ld r0,16(r1) | 870 | ld r0,16(r1) |
871 | mtlr r0 | 871 | mtlr r0 |
872 | blr | 872 | blr |
873 | |||
874 | #ifdef CONFIG_FTRACE | ||
875 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
876 | _GLOBAL(mcount) | ||
877 | _GLOBAL(_mcount) | ||
878 | /* Taken from output of objdump from lib64/glibc */ | ||
879 | mflr r3 | ||
880 | stdu r1, -112(r1) | ||
881 | std r3, 128(r1) | ||
882 | .globl mcount_call | ||
883 | mcount_call: | ||
884 | bl ftrace_stub | ||
885 | nop | ||
886 | ld r0, 128(r1) | ||
887 | mtlr r0 | ||
888 | addi r1, r1, 112 | ||
889 | blr | ||
890 | |||
891 | _GLOBAL(ftrace_caller) | ||
892 | /* Taken from output of objdump from lib64/glibc */ | ||
893 | mflr r3 | ||
894 | ld r11, 0(r1) | ||
895 | stdu r1, -112(r1) | ||
896 | std r3, 128(r1) | ||
897 | ld r4, 16(r11) | ||
898 | .globl ftrace_call | ||
899 | ftrace_call: | ||
900 | bl ftrace_stub | ||
901 | nop | ||
902 | ld r0, 128(r1) | ||
903 | mtlr r0 | ||
904 | addi r1, r1, 112 | ||
905 | _GLOBAL(ftrace_stub) | ||
906 | blr | ||
907 | #else | ||
908 | _GLOBAL(mcount) | ||
909 | blr | ||
910 | |||
911 | _GLOBAL(_mcount) | ||
912 | /* Taken from output of objdump from lib64/glibc */ | ||
913 | mflr r3 | ||
914 | ld r11, 0(r1) | ||
915 | stdu r1, -112(r1) | ||
916 | std r3, 128(r1) | ||
917 | ld r4, 16(r11) | ||
918 | |||
919 | |||
920 | LOAD_REG_ADDR(r5,ftrace_trace_function) | ||
921 | ld r5,0(r5) | ||
922 | ld r5,0(r5) | ||
923 | mtctr r5 | ||
924 | bctrl | ||
925 | |||
926 | nop | ||
927 | ld r0, 128(r1) | ||
928 | mtlr r0 | ||
929 | addi r1, r1, 112 | ||
930 | _GLOBAL(ftrace_stub) | ||
931 | blr | ||
932 | |||
933 | #endif | ||
934 | #endif | ||