qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC 01/14] Make unknown semihosting calls non-fatal


From: Alex Bennée
Subject: Re: [Qemu-devel] [RFC 01/14] Make unknown semihosting calls non-fatal
Date: Thu, 06 Aug 2015 10:11:13 +0100

Christopher Covington <address@hidden> writes:

> Signed-off-by: Christopher Covington <address@hidden>
> ---
>  target-arm/arm-semi.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/target-arm/arm-semi.c b/target-arm/arm-semi.c
> index a8b83e6..bcc70ec 100644
> --- a/target-arm/arm-semi.c
> +++ b/target-arm/arm-semi.c
> @@ -186,8 +186,6 @@ static void arm_semi_flen_cb(CPUState *cs, target_ulong 
> ret, target_ulong err)
>  #define SET_ARG(n, val) put_user_ual(val, args + (n) * 4)
>  uint32_t do_arm_semihosting(CPUARMState *env)
>  {
> -    ARMCPU *cpu = arm_env_get_cpu(env);
> -    CPUState *cs = CPU(cpu);
>      target_ulong args;
>      target_ulong arg0, arg1, arg2, arg3;
>      char * s;
> @@ -195,6 +193,8 @@ uint32_t do_arm_semihosting(CPUARMState *env)
>      uint32_t ret;
>      uint32_t len;
>  #ifdef CONFIG_USER_ONLY
> +    ARMCPU *cpu = arm_env_get_cpu(env);
> +    CPUState *cs = CPU(cpu);
>      TaskState *ts = cs->opaque;
>  #else
>      CPUARMState *ts = env;
> @@ -562,7 +562,6 @@ uint32_t do_arm_semihosting(CPUARMState *env)
>          exit(ret);
>      default:
>          fprintf(stderr, "qemu: Unsupported SemiHosting SWI 0x%02x\n", nr);
> -        cpu_dump_state(cs, stderr, fprintf, 0);
> -        abort();
> +        return -1;

Do SemiHosting calls return anything to the guest? If so removing the
abort means the guest may go unpredictable if the call is just ignored.
If so the argument would be to leave the abort() in and just add the
missing semihosting calls.

>      }
>  }

-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]