|
@@ -348,6 +348,7 @@ static int get_frame_info(struct mips_frame_info *info)
|
|
bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS);
|
|
bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS);
|
|
union mips_instruction insn, *ip, *ip_end;
|
|
union mips_instruction insn, *ip, *ip_end;
|
|
const unsigned int max_insns = 128;
|
|
const unsigned int max_insns = 128;
|
|
|
|
+ unsigned int last_insn_size = 0;
|
|
unsigned int i;
|
|
unsigned int i;
|
|
bool saw_jump = false;
|
|
bool saw_jump = false;
|
|
|
|
|
|
@@ -360,15 +361,19 @@ static int get_frame_info(struct mips_frame_info *info)
|
|
|
|
|
|
ip_end = (void *)ip + info->func_size;
|
|
ip_end = (void *)ip + info->func_size;
|
|
|
|
|
|
- for (i = 0; i < max_insns && ip < ip_end; i++, ip++) {
|
|
|
|
|
|
+ for (i = 0; i < max_insns && ip < ip_end; i++) {
|
|
|
|
+ ip = (void *)ip + last_insn_size;
|
|
if (is_mmips && mm_insn_16bit(ip->halfword[0])) {
|
|
if (is_mmips && mm_insn_16bit(ip->halfword[0])) {
|
|
insn.halfword[0] = 0;
|
|
insn.halfword[0] = 0;
|
|
insn.halfword[1] = ip->halfword[0];
|
|
insn.halfword[1] = ip->halfword[0];
|
|
|
|
+ last_insn_size = 2;
|
|
} else if (is_mmips) {
|
|
} else if (is_mmips) {
|
|
insn.halfword[0] = ip->halfword[1];
|
|
insn.halfword[0] = ip->halfword[1];
|
|
insn.halfword[1] = ip->halfword[0];
|
|
insn.halfword[1] = ip->halfword[0];
|
|
|
|
+ last_insn_size = 4;
|
|
} else {
|
|
} else {
|
|
insn.word = ip->word;
|
|
insn.word = ip->word;
|
|
|
|
+ last_insn_size = 4;
|
|
}
|
|
}
|
|
|
|
|
|
if (!info->frame_size) {
|
|
if (!info->frame_size) {
|
|
@@ -387,8 +392,6 @@ static int get_frame_info(struct mips_frame_info *info)
|
|
tmp = (ip->halfword[0] >> 1);
|
|
tmp = (ip->halfword[0] >> 1);
|
|
info->frame_size = -(signed short)(tmp & 0xf);
|
|
info->frame_size = -(signed short)(tmp & 0xf);
|
|
}
|
|
}
|
|
- ip = (void *) &ip->halfword[1];
|
|
|
|
- ip--;
|
|
|
|
} else
|
|
} else
|
|
#endif
|
|
#endif
|
|
info->frame_size = - ip->i_format.simmediate;
|
|
info->frame_size = - ip->i_format.simmediate;
|