提交 fdf8a960 编写于 作者: A Alexey Kardashevskiy 提交者: Alexander Graf

target-ppc: Move alias lookup after class lookup

This moves aliases lookup after CPU class lookup. This is to let new generic
CPU to be found first if it is present and only if it is not (TCG case), use
aliases.
Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 5b79b1ca
...@@ -8218,12 +8218,6 @@ static ObjectClass *ppc_cpu_class_by_name(const char *name) ...@@ -8218,12 +8218,6 @@ static ObjectClass *ppc_cpu_class_by_name(const char *name)
} }
} }
for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
if (strcmp(ppc_cpu_aliases[i].alias, name) == 0) {
return ppc_cpu_class_by_alias(&ppc_cpu_aliases[i]);
}
}
list = object_class_get_list(TYPE_POWERPC_CPU, false); list = object_class_get_list(TYPE_POWERPC_CPU, false);
item = g_slist_find_custom(list, name, ppc_cpu_compare_class_name); item = g_slist_find_custom(list, name, ppc_cpu_compare_class_name);
if (item != NULL) { if (item != NULL) {
...@@ -8231,7 +8225,17 @@ static ObjectClass *ppc_cpu_class_by_name(const char *name) ...@@ -8231,7 +8225,17 @@ static ObjectClass *ppc_cpu_class_by_name(const char *name)
} }
g_slist_free(list); g_slist_free(list);
return ret; if (ret) {
return ret;
}
for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
if (strcmp(ppc_cpu_aliases[i].alias, name) == 0) {
return ppc_cpu_class_by_alias(&ppc_cpu_aliases[i]);
}
}
return NULL;
} }
PowerPCCPU *cpu_ppc_init(const char *cpu_model) PowerPCCPU *cpu_ppc_init(const char *cpu_model)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册