aboutsummaryrefslogtreecommitdiff
path: root/target-arm/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-27 17:30:10 +0100
committerPeter Maydell <peter.maydell@linaro.org>2013-01-30 16:03:57 +0000
commit51492fd1a99099308d8c20ab7134ffb54abbf374 (patch)
tree6d463b7191700855ee688b66e5d31693903c9875 /target-arm/cpu.c
parente4c1cfa5cb8f8bfbbfd949f2fabbe2be35e60c99 (diff)
target-arm: Rename CPU types
In the initial conversion of CPU models to QOM types, model names were mapped 1:1 to type names. As a side effect this gained us a type "any", which is now a device. To avoid "-device any" silliness and to pave the way for compiling multiple targets into one executable, adopt a <name>-<arch>-cpu scheme. This leads to names like arm926-arm-cpu but is easiest to handle. No functional changes for -cpu arguments or -cpu ? output. Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/cpu.c')
-rw-r--r--target-arm/cpu.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index d1a4c82680..1c6a628df4 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -204,12 +204,15 @@ void arm_cpu_realize(ARMCPU *cpu)
static ObjectClass *arm_cpu_class_by_name(const char *cpu_model)
{
ObjectClass *oc;
+ char *typename;
if (!cpu_model) {
return NULL;
}
- oc = object_class_by_name(cpu_model);
+ typename = g_strdup_printf("%s-" TYPE_ARM_CPU, cpu_model);
+ oc = object_class_by_name(typename);
+ g_free(typename);
if (!oc || !object_class_dynamic_cast(oc, TYPE_ARM_CPU) ||
object_class_is_abstract(oc)) {
return NULL;
@@ -789,14 +792,15 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data)
static void cpu_register(const ARMCPUInfo *info)
{
TypeInfo type_info = {
- .name = info->name,
.parent = TYPE_ARM_CPU,
.instance_size = sizeof(ARMCPU),
.instance_init = info->initfn,
.class_size = sizeof(ARMCPUClass),
};
+ type_info.name = g_strdup_printf("%s-" TYPE_ARM_CPU, info->name);
type_register(&type_info);
+ g_free((void *)type_info.name);
}
static const TypeInfo arm_cpu_type_info = {