target/i386: Remove cur_eip, next_eip arguments to gen_interrupt
All callers pass s->base.pc_next and s->pc, which we can just as well compute within the function. Adjust to use tcg_constant_i32 while we're at it. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20221001140935.465607-5-richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
522365508e
commit
8ed6c98501
@ -2627,13 +2627,12 @@ static void gen_unknown_opcode(CPUX86State *env, DisasContext *s)
|
|||||||
|
|
||||||
/* an interrupt is different from an exception because of the
|
/* an interrupt is different from an exception because of the
|
||||||
privilege checks */
|
privilege checks */
|
||||||
static void gen_interrupt(DisasContext *s, int intno,
|
static void gen_interrupt(DisasContext *s, int intno)
|
||||||
target_ulong cur_eip, target_ulong next_eip)
|
|
||||||
{
|
{
|
||||||
gen_update_cc_op(s);
|
gen_update_cc_op(s);
|
||||||
gen_jmp_im(s, cur_eip);
|
gen_jmp_im(s, s->base.pc_next - s->cs_base);
|
||||||
gen_helper_raise_interrupt(cpu_env, tcg_const_i32(intno),
|
gen_helper_raise_interrupt(cpu_env, tcg_constant_i32(intno),
|
||||||
tcg_const_i32(next_eip - cur_eip));
|
tcg_constant_i32(s->pc - s->base.pc_next));
|
||||||
s->base.is_jmp = DISAS_NORETURN;
|
s->base.is_jmp = DISAS_NORETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7342,12 +7341,12 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0xcc: /* int3 */
|
case 0xcc: /* int3 */
|
||||||
gen_interrupt(s, EXCP03_INT3, s->base.pc_next - s->cs_base, s->pc - s->cs_base);
|
gen_interrupt(s, EXCP03_INT3);
|
||||||
break;
|
break;
|
||||||
case 0xcd: /* int N */
|
case 0xcd: /* int N */
|
||||||
val = x86_ldub_code(env, s);
|
val = x86_ldub_code(env, s);
|
||||||
if (check_vm86_iopl(s)) {
|
if (check_vm86_iopl(s)) {
|
||||||
gen_interrupt(s, val, s->base.pc_next - s->cs_base, s->pc - s->cs_base);
|
gen_interrupt(s, val);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0xce: /* into */
|
case 0xce: /* into */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user