diff options
| -rw-r--r-- | arch/powerpc/kernel/entry_32.S | 40 | ||||
| -rw-r--r-- | arch/powerpc/kernel/entry_64.S | 12 |
2 files changed, 9 insertions, 43 deletions
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 7ecc0d1855c3..6f7eb7e00c79 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
| @@ -1162,39 +1162,17 @@ machine_check_in_rtas: | |||
| 1162 | #ifdef CONFIG_DYNAMIC_FTRACE | 1162 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 1163 | _GLOBAL(mcount) | 1163 | _GLOBAL(mcount) |
| 1164 | _GLOBAL(_mcount) | 1164 | _GLOBAL(_mcount) |
| 1165 | stwu r1,-48(r1) | 1165 | /* |
| 1166 | stw r3, 12(r1) | 1166 | * It is required that _mcount on PPC32 must preserve the |
| 1167 | stw r4, 16(r1) | 1167 | * link register. But we have r0 to play with. We use r0 |
| 1168 | stw r5, 20(r1) | 1168 | * to push the return address back to the caller of mcount |
| 1169 | stw r6, 24(r1) | 1169 | * into the ctr register, restore the link register and |
| 1170 | mflr r3 | 1170 | * then jump back using the ctr register. |
| 1171 | stw r7, 28(r1) | 1171 | */ |
| 1172 | mfcr r5 | 1172 | mflr r0 |
| 1173 | stw r8, 32(r1) | ||
| 1174 | stw r9, 36(r1) | ||
| 1175 | stw r10,40(r1) | ||
| 1176 | stw r3, 44(r1) | ||
| 1177 | stw r5, 8(r1) | ||
| 1178 | subi r3, r3, MCOUNT_INSN_SIZE | ||
| 1179 | .globl mcount_call | ||
| 1180 | mcount_call: | ||
| 1181 | bl ftrace_stub | ||
| 1182 | nop | ||
| 1183 | lwz r6, 8(r1) | ||
| 1184 | lwz r0, 44(r1) | ||
| 1185 | lwz r3, 12(r1) | ||
| 1186 | mtctr r0 | 1173 | mtctr r0 |
| 1187 | lwz r4, 16(r1) | 1174 | lwz r0, 4(r1) |
| 1188 | mtcr r6 | ||
| 1189 | lwz r5, 20(r1) | ||
| 1190 | lwz r6, 24(r1) | ||
| 1191 | lwz r0, 52(r1) | ||
| 1192 | lwz r7, 28(r1) | ||
| 1193 | lwz r8, 32(r1) | ||
| 1194 | mtlr r0 | 1175 | mtlr r0 |
| 1195 | lwz r9, 36(r1) | ||
| 1196 | lwz r10,40(r1) | ||
| 1197 | addi r1, r1, 48 | ||
| 1198 | bctr | 1176 | bctr |
| 1199 | 1177 | ||
| 1200 | _GLOBAL(ftrace_caller) | 1178 | _GLOBAL(ftrace_caller) |
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index e6d52845854f..b00982e0d1ee 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
| @@ -888,18 +888,6 @@ _GLOBAL(enter_prom) | |||
| 888 | #ifdef CONFIG_DYNAMIC_FTRACE | 888 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 889 | _GLOBAL(mcount) | 889 | _GLOBAL(mcount) |
| 890 | _GLOBAL(_mcount) | 890 | _GLOBAL(_mcount) |
| 891 | /* Taken from output of objdump from lib64/glibc */ | ||
| 892 | mflr r3 | ||
| 893 | stdu r1, -112(r1) | ||
| 894 | std r3, 128(r1) | ||
| 895 | subi r3, r3, MCOUNT_INSN_SIZE | ||
| 896 | .globl mcount_call | ||
| 897 | mcount_call: | ||
| 898 | bl ftrace_stub | ||
| 899 | nop | ||
| 900 | ld r0, 128(r1) | ||
| 901 | mtlr r0 | ||
| 902 | addi r1, r1, 112 | ||
| 903 | blr | 891 | blr |
| 904 | 892 | ||
| 905 | _GLOBAL(ftrace_caller) | 893 | _GLOBAL(ftrace_caller) |
