qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC qom-cpu 14/15] target-unicore32: Introduce QOM rea


From: guanxuetao
Subject: Re: [Qemu-devel] [RFC qom-cpu 14/15] target-unicore32: Introduce QOM realizefn for UniCore32CPU
Date: Wed, 16 Jan 2013 20:08:13 +0800 (CST)
User-agent: SquirrelMail/1.4.8-4.0.1.el5

> Introduce a realizefn and set realized = true in uc32_cpu_init().
>
> Signed-off-by: Andreas F盲rber <address@hidden>

LGTM.

Acked-by: Guan Xuetao <address@hidden>

> ---
>  target-unicore32/cpu.c    |   15 +++++++++++++++
>  target-unicore32/helper.c |    2 +-
>  2 Dateien ge盲ndert, 16 Zeilen hinzugef眉gt(+), 1 Zeile entfernt(-)
>
> diff --git a/target-unicore32/cpu.c b/target-unicore32/cpu.c
> index 884c101..22330ad 100644
> --- a/target-unicore32/cpu.c
> +++ b/target-unicore32/cpu.c
> @@ -61,6 +61,13 @@ static const UniCore32CPUInfo uc32_cpus[] = {
>      { .name = "any",        .instance_init = uc32_any_cpu_initfn },
>  };
>
> +static void uc32_cpu_realizefn(DeviceState *dev, Error **errp)
> +{
> +    UniCore32CPU *cpu = UNICORE32_CPU(dev);
> +
> +    qemu_init_vcpu(&cpu->env);
> +}
> +
>  static void uc32_cpu_initfn(Object *obj)
>  {
>      UniCore32CPU *cpu = UNICORE32_CPU(obj);
> @@ -80,6 +87,13 @@ static void uc32_cpu_initfn(Object *obj)
>      tlb_flush(env, 1);
>  }
>
> +static void uc32_cpu_class_init(ObjectClass *oc, void *data)
> +{
> +    DeviceClass *dc = DEVICE_CLASS(oc);
> +
> +    dc->realize = uc32_cpu_realizefn;
> +}
> +
>  static void uc32_register_cpu_type(const UniCore32CPUInfo *info)
>  {
>      TypeInfo type_info = {
> @@ -98,6 +112,7 @@ static const TypeInfo uc32_cpu_type_info = {
>      .instance_init = uc32_cpu_initfn,
>      .abstract = true,
>      .class_size = sizeof(UniCore32CPUClass),
> +    .class_init = uc32_cpu_class_init,
>  };
>
>  static void uc32_cpu_register_types(void)
> diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
> index 5359538..347d842 100644
> --- a/target-unicore32/helper.c
> +++ b/target-unicore32/helper.c
> @@ -42,7 +42,7 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
>          uc32_translate_init();
>      }
>
> -    qemu_init_vcpu(env);
> +    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
>      return env;
>  }
>
> --
> 1.7.10.4
>




reply via email to

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