Am 23.01.2013 13:07, schrieb Andreas Färber:
> diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
> index 5359538..7ace68c 100644
> --- a/target-unicore32/helper.c
> +++ b/target-unicore32/helper.c
> @@ -29,9 +29,11 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
> {
> UniCore32CPU *cpu;
> CPUUniCore32State *env;
> + ObjectClass *oc;
> static int inited = 1;
>
> - if (object_class_by_name(cpu_model) == NULL) {
> + oc = cpu_class_by_name(TYPE_UNICORE32_CPU, cpu_model);
> + if (oc == NULL) {
> return NULL;
> }
> cpu = UNICORE32_CPU(object_new(cpu_model));
Should be using object_class_get_name(oc) instead of cpu_model:
diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
index 7ace68c..183b5b3 100644
--- a/target-unicore32/helper.c
+++ b/target-unicore32/helper.c
@@ -36,7 +36,7 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
if (oc == NULL) {
return NULL;
}
- cpu = UNICORE32_CPU(object_new(cpu_model));
+ cpu = UNICORE32_CPU(object_new(object_class_get_name(oc)));
env = &cpu->env;
if (inited) {
Fixed.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg