diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2019-12-17 15:08:57 +0000 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2020-01-09 11:41:29 +0000 |
commit | 4ff5ef9e911c670ca10cdd36dd27c5395ec2c753 (patch) | |
tree | 5abc54db219c91ed383e48bbfaad767b8628b1e9 /target/arm/helper.c | |
parent | b906acbb3aceed5b1eca30d9d365d5bd7431400b (diff) |
target/arm: only update pc after semihosting completes
Before we introduce blocking semihosting calls we need to ensure we
can restart the system on semi hosting exception. To be able to do
this the EXCP_SEMIHOST operation should be idempotent until it finally
completes. Practically this means ensureing we only update the pc
after the semihosting call has completed.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'target/arm/helper.c')
-rw-r--r-- | target/arm/helper.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c index da22c19800..19a57a17da 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -8614,11 +8614,13 @@ static void handle_semihosting(CPUState *cs) "...handling as semihosting call 0x%" PRIx64 "\n", env->xregs[0]); env->xregs[0] = do_arm_semihosting(env); + env->pc += 4; } else { qemu_log_mask(CPU_LOG_INT, "...handling as semihosting call 0x%x\n", env->regs[0]); env->regs[0] = do_arm_semihosting(env); + env->regs[15] += env->thumb ? 2 : 4; } } #endif |