target/m68k: Remove retaddr in m68k_interrupt_all

The only value this variable holds is now env->pc.

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220602013401.303699-6-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Richard Henderson 2022-06-01 18:33:49 -07:00 committed by Laurent Vivier
parent cf213dacf8
commit 035c6e7b5d

View File

@ -287,12 +287,9 @@ static void m68k_interrupt_all(CPUM68KState *env, int is_hw)
{ {
CPUState *cs = env_cpu(env); CPUState *cs = env_cpu(env);
uint32_t sp; uint32_t sp;
uint32_t retaddr;
uint32_t vector; uint32_t vector;
uint16_t sr, oldsr; uint16_t sr, oldsr;
retaddr = env->pc;
if (!is_hw) { if (!is_hw) {
switch (cs->exception_index) { switch (cs->exception_index) {
case EXCP_RTE: case EXCP_RTE:
@ -385,7 +382,7 @@ static void m68k_interrupt_all(CPUM68KState *env, int is_hw)
sp -= 4; sp -= 4;
cpu_stl_mmuidx_ra(env, sp, env->mmu.ar, MMU_KERNEL_IDX, 0); cpu_stl_mmuidx_ra(env, sp, env->mmu.ar, MMU_KERNEL_IDX, 0);
do_stack_frame(env, &sp, 7, oldsr, 0, retaddr); do_stack_frame(env, &sp, 7, oldsr, 0, env->pc);
env->mmu.fault = false; env->mmu.fault = false;
if (qemu_loglevel_mask(CPU_LOG_INT)) { if (qemu_loglevel_mask(CPU_LOG_INT)) {
qemu_log(" " qemu_log(" "
@ -395,7 +392,7 @@ static void m68k_interrupt_all(CPUM68KState *env, int is_hw)
break; break;
case EXCP_ADDRESS: case EXCP_ADDRESS:
do_stack_frame(env, &sp, 2, oldsr, 0, retaddr); do_stack_frame(env, &sp, 2, oldsr, 0, env->pc);
break; break;
case EXCP_ILLEGAL: case EXCP_ILLEGAL:
@ -404,12 +401,12 @@ static void m68k_interrupt_all(CPUM68KState *env, int is_hw)
case EXCP_TRAPCC: case EXCP_TRAPCC:
case EXCP_TRACE: case EXCP_TRACE:
/* FIXME: addr is not only env->pc */ /* FIXME: addr is not only env->pc */
do_stack_frame(env, &sp, 2, oldsr, env->pc, retaddr); do_stack_frame(env, &sp, 2, oldsr, env->pc, env->pc);
break; break;
case EXCP_SPURIOUS ... EXCP_INT_LEVEL_7: case EXCP_SPURIOUS ... EXCP_INT_LEVEL_7:
if (is_hw && (oldsr & SR_M)) { if (is_hw && (oldsr & SR_M)) {
do_stack_frame(env, &sp, 0, oldsr, 0, retaddr); do_stack_frame(env, &sp, 0, oldsr, 0, env->pc);
oldsr = sr; oldsr = sr;
env->aregs[7] = sp; env->aregs[7] = sp;
cpu_m68k_set_sr(env, sr & ~SR_M); cpu_m68k_set_sr(env, sr & ~SR_M);
@ -417,13 +414,13 @@ static void m68k_interrupt_all(CPUM68KState *env, int is_hw)
if (!m68k_feature(env, M68K_FEATURE_UNALIGNED_DATA)) { if (!m68k_feature(env, M68K_FEATURE_UNALIGNED_DATA)) {
sp &= ~1; sp &= ~1;
} }
do_stack_frame(env, &sp, 1, oldsr, 0, retaddr); do_stack_frame(env, &sp, 1, oldsr, 0, env->pc);
break; break;
} }
/* fall through */ /* fall through */
default: default:
do_stack_frame(env, &sp, 0, oldsr, 0, retaddr); do_stack_frame(env, &sp, 0, oldsr, 0, env->pc);
break; break;
} }