[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v11 01/29] Pass generic CPUState to gen_intermedia
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-ppc] [PATCH v11 01/29] Pass generic CPUState to gen_intermediate_code() |
Date: |
Thu, 29 Jun 2017 18:52:25 -0400 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Jun 28, 2017 at 15:20:42 +0300, Lluís Vilanova wrote:
> Needed to implement a target-agnostic gen_intermediate_code() in the
> future.
>
> Signed-off-by: Lluís Vilanova <address@hidden>
> Reviewed-by: David Gibson <address@hidden>
> Reviewed-by: Richard Henderson <address@hidden>
> ---
(snip)
> -void gen_intermediate_code(CPUAlphaState *env, struct TranslationBlock *tb)
> +void gen_intermediate_code(CPUState *cpu, struct TranslationBlock *tb)
> {
> - AlphaCPU *cpu = alpha_env_get_cpu(env);
> - CPUState *cs = CPU(cpu);
> + CPUAlphaState *env = cpu->env_ptr;
I'd keep the original variable names, i.e. cs for CPUState in this case,
just like you did for a64:
> -void gen_intermediate_code_a64(ARMCPU *cpu, TranslationBlock *tb)
> +void gen_intermediate_code_a64(CPUState *cs, TranslationBlock *tb)
> {
> - CPUState *cs = CPU(cpu);
> - CPUARMState *env = &cpu->env;
> + CPUARMState *env = cs->env_ptr;
> + ARMCPU *cpu = arm_env_get_cpu(env);
This will keep the diff size to a minimum.
E.