aboutsummaryrefslogtreecommitdiff
path: root/target-alpha/cpu.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-21 18:26:21 +0100
committerAndreas Färber <afaerber@suse.de>2013-01-27 14:52:04 +0100
commit2b8c27549917b3e07fec5807dbd2b6528ceb4efa (patch)
tree20fca5c542c32daf4d8479114d76efdcd232f0a1 /target-alpha/cpu.c
parent2c728dfef56d468a6a80b4dacdfb7109220d2546 (diff)
cpu: Add model resolution support to CPUClass
Introduce CPUClass::class_by_name and add a default implementation. Hook up the alpha and ppc implementations. Introduce a wrapper function cpu_class_by_name(). Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-alpha/cpu.c')
-rw-r--r--target-alpha/cpu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c
index 40e980933f..3ac0fde2cd 100644
--- a/target-alpha/cpu.c
+++ b/target-alpha/cpu.c
@@ -244,6 +244,13 @@ static void alpha_cpu_initfn(Object *obj)
env->fen = 1;
}
+static void alpha_cpu_class_init(ObjectClass *oc, void *data)
+{
+ CPUClass *cc = CPU_CLASS(oc);
+
+ cc->class_by_name = alpha_cpu_class_by_name;
+}
+
static const TypeInfo alpha_cpu_type_info = {
.name = TYPE_ALPHA_CPU,
.parent = TYPE_CPU,
@@ -251,6 +258,7 @@ static const TypeInfo alpha_cpu_type_info = {
.instance_init = alpha_cpu_initfn,
.abstract = true,
.class_size = sizeof(AlphaCPUClass),
+ .class_init = alpha_cpu_class_init,
};
static void alpha_cpu_register_types(void)