diff options
author | Franck Bui-Huu <vagabon.xyz@gmail.com> | 2006-08-03 03:29:20 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-09-27 08:37:28 -0400 |
commit | 0cceb4aa9acf6192a5f02134e764b1feeea8b9de (patch) | |
tree | 9c5dd31e00b7e7b3fcc694bd0d4e6213614a66c7 /arch/mips/kernel/process.c | |
parent | 1666a6fc73f724cdc6bd7d699f9ada4b04953efe (diff) |
[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 <vagabon.xyz@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/process.c')
-rw-r--r-- | arch/mips/kernel/process.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index da332d707ce5..309bfa4a1520 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) | |||
321 | 321 | ||
322 | if (is_jal_jalr_jr_ins(ip)) | 322 | if (is_jal_jalr_jr_ins(ip)) |
323 | break; | 323 | break; |
324 | if (is_sp_move_ins(ip)) { | 324 | if (!info->frame_size) { |
325 | if (info->frame_size) | 325 | if (is_sp_move_ins(ip)) |
326 | continue; | 326 | info->frame_size = - ip->i_format.simmediate; |
327 | info->frame_size = - ip->i_format.simmediate; | 327 | continue; |
328 | } | 328 | } |
329 | 329 | if (info->pc_offset == -1 && is_ra_save_ins(ip)) { | |
330 | if (is_ra_save_ins(ip)) { | ||
331 | if (info->pc_offset != -1) | ||
332 | continue; | ||
333 | info->pc_offset = | 330 | info->pc_offset = |
334 | ip->i_format.simmediate / sizeof(long); | 331 | ip->i_format.simmediate / sizeof(long); |
332 | break; | ||
335 | } | 333 | } |
336 | } | 334 | } |
337 | if (info->frame_size && info->pc_offset >= 0) /* nested */ | 335 | if (info->frame_size && info->pc_offset >= 0) /* nested */ |