aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/traps.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-08-28 23:10:22 -0400
committerRalf Baechle <ralf@linux-mips.org>2006-09-27 08:37:37 -0400
commit898d229107f7aa8ea45685c11e2930783755f9ba (patch)
treebcff787ee7f792571c7b1b8e480a80b8da04c45b /arch/mips/kernel/traps.c
parentf6502791d780b22fc147150137704a07a05ba361 (diff)
[MIPS] Make prepare_frametrace() not clobber v0
Since lmo commit 323a380bf9e1a1679a774a2b053e3c1f2aa3f179 ("Simplify dump_stack()") made prepare_frametrace() always inlined, using $2 (v0) in __asm__ is not safe anymore. We can use $1 (at) instead. Also we should use "dla" instead of "la" for 64-bit kernel. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r--arch/mips/kernel/traps.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index ab77034921c4..e51d8fd9a152 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -161,16 +161,20 @@ static void show_stacktrace(struct task_struct *task, struct pt_regs *regs)
161static __always_inline void prepare_frametrace(struct pt_regs *regs) 161static __always_inline void prepare_frametrace(struct pt_regs *regs)
162{ 162{
163 __asm__ __volatile__( 163 __asm__ __volatile__(
164 "1: la $2, 1b\n\t" 164 ".set push\n\t"
165 ".set noat\n\t"
165#ifdef CONFIG_64BIT 166#ifdef CONFIG_64BIT
166 "sd $2, %0\n\t" 167 "1: dla $1, 1b\n\t"
168 "sd $1, %0\n\t"
167 "sd $29, %1\n\t" 169 "sd $29, %1\n\t"
168 "sd $31, %2\n\t" 170 "sd $31, %2\n\t"
169#else 171#else
170 "sw $2, %0\n\t" 172 "1: la $1, 1b\n\t"
173 "sw $1, %0\n\t"
171 "sw $29, %1\n\t" 174 "sw $29, %1\n\t"
172 "sw $31, %2\n\t" 175 "sw $31, %2\n\t"
173#endif 176#endif
177 ".set pop\n\t"
174 : "=m" (regs->cp0_epc), 178 : "=m" (regs->cp0_epc),
175 "=m" (regs->regs[29]), "=m" (regs->regs[31]) 179 "=m" (regs->regs[29]), "=m" (regs->regs[31])
176 : : "memory"); 180 : : "memory");