qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 03/13] target-sh4: Start QOM'ifying CPU init


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 03/13] target-sh4: Start QOM'ifying CPU init
Date: Mon, 16 Apr 2012 15:33:24 +0100

On 13 April 2012 22:30, Andreas Färber <address@hidden> wrote:
> Move code from cpu_sh4_init() into a QOM initfn.
>
> Signed-off-by: Andreas Färber <address@hidden>
> ---
>  target-sh4/cpu.c       |   13 +++++++++++++
>  target-sh4/translate.c |    3 ---
>  2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/target-sh4/cpu.c b/target-sh4/cpu.c
> index 062d737..948cfac 100644
> --- a/target-sh4/cpu.c
> +++ b/target-sh4/cpu.c
> @@ -53,6 +53,18 @@ static void superh_cpu_reset(CPUState *s)
>     set_default_nan_mode(1, &env->fp_status);
>  }
>
> +static void superh_cpu_initfn(Object *obj)
> +{
> +    SuperHCPU *cpu = SUPERH_CPU(obj);
> +    CPUSH4State *env = &cpu->env;
> +
> +    cpu_exec_init(env);
> +
> +    env->movcal_backup_tail = &(env->movcal_backup);
> +
> +    cpu_reset(CPU(cpu));
> +}

Do the other qom conversions do a cpu reset in the instance
init function? I don't think the ARM one does (and it would
probably be bad if it did since reset for some ARM cores
requires loading values from guest memory so it can't happen
before the whole of the model has been set up.)
We should aim for consistency across targets here I think.

-- PMM



reply via email to

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