diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-15 01:44:51 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-15 01:44:51 -0400 |
commit | 43d2548bb2ef7e6d753f91468a746784041e522d (patch) | |
tree | 77d13fcd48fd998393abb825ec36e2b732684a73 /arch/powerpc/kernel/entry_64.S | |
parent | 585583d95c5660973bc0cf64add517b040acd8a4 (diff) | |
parent | 85082fd7cbe3173198aac0eb5e85ab1edcc6352c (diff) |
Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build
Manual fixup of:
arch/powerpc/Kconfig
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 12eb95a80ce9..d7369243ae44 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <asm/bug.h> | 31 | #include <asm/bug.h> |
32 | #include <asm/ptrace.h> | 32 | #include <asm/ptrace.h> |
33 | #include <asm/irqflags.h> | 33 | #include <asm/irqflags.h> |
34 | #include <asm/ftrace.h> | ||
34 | 35 | ||
35 | /* | 36 | /* |
36 | * System calls. | 37 | * System calls. |
@@ -875,3 +876,67 @@ _GLOBAL(enter_prom) | |||
875 | ld r0,16(r1) | 876 | ld r0,16(r1) |
876 | mtlr r0 | 877 | mtlr r0 |
877 | blr | 878 | blr |
879 | |||
880 | #ifdef CONFIG_FTRACE | ||
881 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
882 | _GLOBAL(mcount) | ||
883 | _GLOBAL(_mcount) | ||
884 | /* Taken from output of objdump from lib64/glibc */ | ||
885 | mflr r3 | ||
886 | stdu r1, -112(r1) | ||
887 | std r3, 128(r1) | ||
888 | subi r3, r3, MCOUNT_INSN_SIZE | ||
889 | .globl mcount_call | ||
890 | mcount_call: | ||
891 | bl ftrace_stub | ||
892 | nop | ||
893 | ld r0, 128(r1) | ||
894 | mtlr r0 | ||
895 | addi r1, r1, 112 | ||
896 | blr | ||
897 | |||
898 | _GLOBAL(ftrace_caller) | ||
899 | /* Taken from output of objdump from lib64/glibc */ | ||
900 | mflr r3 | ||
901 | ld r11, 0(r1) | ||
902 | stdu r1, -112(r1) | ||
903 | std r3, 128(r1) | ||
904 | ld r4, 16(r11) | ||
905 | subi r3, r3, MCOUNT_INSN_SIZE | ||
906 | .globl ftrace_call | ||
907 | ftrace_call: | ||
908 | bl ftrace_stub | ||
909 | nop | ||
910 | ld r0, 128(r1) | ||
911 | mtlr r0 | ||
912 | addi r1, r1, 112 | ||
913 | _GLOBAL(ftrace_stub) | ||
914 | blr | ||
915 | #else | ||
916 | _GLOBAL(mcount) | ||
917 | blr | ||
918 | |||
919 | _GLOBAL(_mcount) | ||
920 | /* Taken from output of objdump from lib64/glibc */ | ||
921 | mflr r3 | ||
922 | ld r11, 0(r1) | ||
923 | stdu r1, -112(r1) | ||
924 | std r3, 128(r1) | ||
925 | ld r4, 16(r11) | ||
926 | |||
927 | subi r3, r3, MCOUNT_INSN_SIZE | ||
928 | LOAD_REG_ADDR(r5,ftrace_trace_function) | ||
929 | ld r5,0(r5) | ||
930 | ld r5,0(r5) | ||
931 | mtctr r5 | ||
932 | bctrl | ||
933 | |||
934 | nop | ||
935 | ld r0, 128(r1) | ||
936 | mtlr r0 | ||
937 | addi r1, r1, 112 | ||
938 | _GLOBAL(ftrace_stub) | ||
939 | blr | ||
940 | |||
941 | #endif | ||
942 | #endif | ||