mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
2c728dfef5
commit
2b8c275499
4 changed files with 38 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue