Commit bc1c969f authored by Huacai Chen's avatar Huacai Chen Committed by Thomas Bogendoerfer

MIPS: Loongson-3: Calculate ra properly when unwinding the stack

Loongson-3 has 16-bytes load/store instructions: gslq and gssq. This
patch calculate ra properly when unwinding the stack, if ra is saved
by gssq and restored by gslq.
Signed-off-by: default avatarHuacai Chen <chenhc@lemote.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 195615ec
......@@ -279,7 +279,21 @@ static inline int is_ra_save_ins(union mips_instruction *ip, int *poff)
*poff = ip->i_format.simmediate / sizeof(ulong);
return 1;
}
#ifdef CONFIG_CPU_LOONGSON64
if ((ip->loongson3_lswc2_format.opcode == swc2_op) &&
(ip->loongson3_lswc2_format.ls == 1) &&
(ip->loongson3_lswc2_format.fr == 0) &&
(ip->loongson3_lswc2_format.base == 29)) {
if (ip->loongson3_lswc2_format.rt == 31) {
*poff = ip->loongson3_lswc2_format.offset << 1;
return 1;
}
if (ip->loongson3_lswc2_format.rq == 31) {
*poff = (ip->loongson3_lswc2_format.offset << 1) + 1;
return 1;
}
}
#endif
return 0;
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment