qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 26/35] target/unicore32: access cpu->interrupt_r


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH 26/35] target/unicore32: access cpu->interrupt_request with atomics
Date: Wed, 19 Sep 2018 23:11:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 9/17/18 6:30 PM, Emilio G. Cota wrote:
> From: Paolo Bonzini <address@hidden>
> 
> Cc: Guan Xuetao <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> Signed-off-by: Emilio G. Cota <address@hidden>

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

> ---
>  target/unicore32/cpu.c     | 2 +-
>  target/unicore32/softmmu.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c
> index 68f978d80b..4e4ee2ee78 100644
> --- a/target/unicore32/cpu.c
> +++ b/target/unicore32/cpu.c
> @@ -29,7 +29,7 @@ static void uc32_cpu_set_pc(CPUState *cs, vaddr value)
>  
>  static bool uc32_cpu_has_work(CPUState *cs)
>  {
> -    return cs->interrupt_request &
> +    return atomic_read(&cs->interrupt_request) &
>          (CPU_INTERRUPT_HARD | CPU_INTERRUPT_EXITTB);
>  }
>  
> diff --git a/target/unicore32/softmmu.c b/target/unicore32/softmmu.c
> index 00c7e0d028..d84ef67d0d 100644
> --- a/target/unicore32/softmmu.c
> +++ b/target/unicore32/softmmu.c
> @@ -119,7 +119,7 @@ void uc32_cpu_do_interrupt(CPUState *cs)
>      /* The PC already points to the proper instruction.  */
>      env->regs[30] = env->regs[31];
>      env->regs[31] = addr;
> -    cs->interrupt_request |= CPU_INTERRUPT_EXITTB;
> +    atomic_or(&cs->interrupt_request, CPU_INTERRUPT_EXITTB);
>  }
>  
>  static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address,
> 



reply via email to

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