From: Franck Bui-Huu Date: Thu, 3 Aug 2006 07:29:20 +0000 (+0200) Subject: [MIPS] Make get_frame_info() more robust X-Git-Tag: v2.6.19-rc1~1062 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cceb4aa9acf6192a5f02134e764b1feeea8b9de;p=linux-2.6 [MIPS] Make get_frame_info() more robust Now get_frame_info() wants to detect move sp instruction first. It assumes that the save ra in the stack instruction can't happen before allocating frame size space into the stack. Signed-off-by: Franck Bui-Huu Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index da332d707c..309bfa4a15 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -321,17 +321,15 @@ static int get_frame_info(struct mips_frame_info *info) if (is_jal_jalr_jr_ins(ip)) break; - if (is_sp_move_ins(ip)) { - if (info->frame_size) - continue; - info->frame_size = - ip->i_format.simmediate; + if (!info->frame_size) { + if (is_sp_move_ins(ip)) + info->frame_size = - ip->i_format.simmediate; + continue; } - - if (is_ra_save_ins(ip)) { - if (info->pc_offset != -1) - continue; + if (info->pc_offset == -1 && is_ra_save_ins(ip)) { info->pc_offset = ip->i_format.simmediate / sizeof(long); + break; } } if (info->frame_size && info->pc_offset >= 0) /* nested */