diff options
-rw-r--r-- | arch/mips/kernel/mcount.S | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S index 9a029d40f6cf..6bfcb7a00ec6 100644 --- a/arch/mips/kernel/mcount.S +++ b/arch/mips/kernel/mcount.S | |||
@@ -57,6 +57,12 @@ | |||
57 | move ra, AT | 57 | move ra, AT |
58 | .endm | 58 | .endm |
59 | 59 | ||
60 | /* | ||
61 | * The -mmcount-ra-address option of gcc 4.5 uses register $12 to pass | ||
62 | * the location of the parent's return address. | ||
63 | */ | ||
64 | #define MCOUNT_RA_ADDRESS_REG $12 | ||
65 | |||
60 | #ifdef CONFIG_DYNAMIC_FTRACE | 66 | #ifdef CONFIG_DYNAMIC_FTRACE |
61 | 67 | ||
62 | NESTED(ftrace_caller, PT_SIZE, ra) | 68 | NESTED(ftrace_caller, PT_SIZE, ra) |
@@ -70,7 +76,7 @@ _mcount: | |||
70 | 76 | ||
71 | MCOUNT_SAVE_REGS | 77 | MCOUNT_SAVE_REGS |
72 | #ifdef KBUILD_MCOUNT_RA_ADDRESS | 78 | #ifdef KBUILD_MCOUNT_RA_ADDRESS |
73 | PTR_S t0, PT_R12(sp) /* save location of parent's return address */ | 79 | PTR_S MCOUNT_RA_ADDRESS_REG, PT_R12(sp) |
74 | #endif | 80 | #endif |
75 | 81 | ||
76 | move a0, ra /* arg1: self return address */ | 82 | move a0, ra /* arg1: self return address */ |
@@ -142,9 +148,9 @@ NESTED(ftrace_graph_caller, PT_SIZE, ra) | |||
142 | #ifdef CONFIG_DYNAMIC_FTRACE | 148 | #ifdef CONFIG_DYNAMIC_FTRACE |
143 | PTR_L a0, PT_R12(sp) | 149 | PTR_L a0, PT_R12(sp) |
144 | #else | 150 | #else |
145 | move a0, t0 | 151 | move a0, MCOUNT_RA_ADDRESS_REG |
146 | #endif | 152 | #endif |
147 | bnez a0, 1f /* non-leaf func: stored in t0 */ | 153 | bnez a0, 1f /* non-leaf func: stored in MCOUNT_RA_ADDRESS_REG */ |
148 | nop | 154 | nop |
149 | #endif | 155 | #endif |
150 | PTR_LA a0, PT_R1(sp) /* leaf func: the location in current stack */ | 156 | PTR_LA a0, PT_R1(sp) /* leaf func: the location in current stack */ |