qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 02/14] target-arm: Move feature bit settings


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2 02/14] target-arm: Move feature bit settings to CPU init fns
Date: Sat, 14 Apr 2012 19:52:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0

Am 14.04.2012 18:42, schrieb Peter Maydell:
> Move the setting of the feature bits from cpu_reset_model_id()
> to each CPU's instance init function. This requires us to move
> the features field in CPUARMState so that it is not cleared
> on reset.
> 
> Signed-off-by: Peter Maydell <address@hidden>
> ---
>  target-arm/cpu-qom.h |    1 +
>  target-arm/cpu.c     |  136 
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>  target-arm/cpu.h     |    6 +-
>  target-arm/helper.c  |   97 +-----------------------------------
>  4 files changed, 141 insertions(+), 99 deletions(-)
> 
> diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h
> index a4bcb31..7e2d4c9 100644
> --- a/target-arm/cpu-qom.h
> +++ b/target-arm/cpu-qom.h
> @@ -79,5 +79,6 @@ static inline ARMCPU *arm_env_get_cpu(CPUARMState *env)
>  
>  #define ENV_GET_CPU(e) CPU(arm_env_get_cpu(e))
>  
> +void arm_cpu_realize(ARMCPU *cpu);
>  
>  #endif
> diff --git a/target-arm/cpu.c b/target-arm/cpu.c
> index 3565472..958f5c5 100644
> --- a/target-arm/cpu.c
> +++ b/target-arm/cpu.c
[...]
> @@ -41,161 +46,292 @@ static void arm_cpu_initfn(Object *obj)
>      cpu_exec_init(&cpu->env);
>  }
>  
> +void arm_cpu_realize(ARMCPU *cpu)
> +{
[...]
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index afcd68c..e495de6 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
[...]
> @@ -413,6 +317,7 @@ CPUARMState *cpu_arm_init(const char *cpu_model)
>      cpu = ARM_CPU(object_new(cpu_model));
>      env = &cpu->env;
>      env->cpu_model_str = cpu_model;
> +    arm_cpu_realize(cpu);

My idea behind suggesting realize for this on IRC was to prepare a
function that can be hooked up to klass->realize later, i.e. taking an
Object *obj and Error **errp, returning an int indicating success.

But since we'd (in order) remove, modify and drop these lines once
realize gets applied it doesn't really matter too much.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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