mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
hw/cpu/arm: Declare CPU QOM types using DEFINE_TYPES() macro
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-id: 20250130112615.3219-7-philmd@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
f096139656
commit
3272ddee8c
4 changed files with 36 additions and 48 deletions
|
@ -164,17 +164,14 @@ static void a15mp_priv_class_init(ObjectClass *klass, void *data)
|
||||||
/* We currently have no saveable state */
|
/* We currently have no saveable state */
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo a15mp_priv_info = {
|
static const TypeInfo a15mp_types[] = {
|
||||||
.name = TYPE_A15MPCORE_PRIV,
|
{
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.name = TYPE_A15MPCORE_PRIV,
|
||||||
.instance_size = sizeof(A15MPPrivState),
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_init = a15mp_priv_initfn,
|
.instance_size = sizeof(A15MPPrivState),
|
||||||
.class_init = a15mp_priv_class_init,
|
.instance_init = a15mp_priv_initfn,
|
||||||
|
.class_init = a15mp_priv_class_init,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void a15mp_register_types(void)
|
DEFINE_TYPES(a15mp_types)
|
||||||
{
|
|
||||||
type_register_static(&a15mp_priv_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(a15mp_register_types)
|
|
||||||
|
|
|
@ -177,17 +177,14 @@ static void a9mp_priv_class_init(ObjectClass *klass, void *data)
|
||||||
device_class_set_props(dc, a9mp_priv_properties);
|
device_class_set_props(dc, a9mp_priv_properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo a9mp_priv_info = {
|
static const TypeInfo a9mp_types[] = {
|
||||||
.name = TYPE_A9MPCORE_PRIV,
|
{
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.name = TYPE_A9MPCORE_PRIV,
|
||||||
.instance_size = sizeof(A9MPPrivState),
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_init = a9mp_priv_initfn,
|
.instance_size = sizeof(A9MPPrivState),
|
||||||
.class_init = a9mp_priv_class_init,
|
.instance_init = a9mp_priv_initfn,
|
||||||
|
.class_init = a9mp_priv_class_init,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void a9mp_register_types(void)
|
DEFINE_TYPES(a9mp_types)
|
||||||
{
|
|
||||||
type_register_static(&a9mp_priv_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(a9mp_register_types)
|
|
||||||
|
|
|
@ -152,17 +152,14 @@ static void mpcore_priv_class_init(ObjectClass *klass, void *data)
|
||||||
device_class_set_props(dc, mpcore_priv_properties);
|
device_class_set_props(dc, mpcore_priv_properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo mpcore_priv_info = {
|
static const TypeInfo arm11mp_types[] = {
|
||||||
.name = TYPE_ARM11MPCORE_PRIV,
|
{
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.name = TYPE_ARM11MPCORE_PRIV,
|
||||||
.instance_size = sizeof(ARM11MPCorePriveState),
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_init = mpcore_priv_initfn,
|
.instance_size = sizeof(ARM11MPCorePriveState),
|
||||||
.class_init = mpcore_priv_class_init,
|
.instance_init = mpcore_priv_initfn,
|
||||||
|
.class_init = mpcore_priv_class_init,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void arm11mpcore_register_types(void)
|
DEFINE_TYPES(arm11mp_types)
|
||||||
{
|
|
||||||
type_register_static(&mpcore_priv_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(arm11mpcore_register_types)
|
|
||||||
|
|
|
@ -114,17 +114,14 @@ static void mpcore_rirq_class_init(ObjectClass *klass, void *data)
|
||||||
dc->realize = realview_mpcore_realize;
|
dc->realize = realview_mpcore_realize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo mpcore_rirq_info = {
|
static const TypeInfo realview_mpcore_types[] = {
|
||||||
.name = TYPE_REALVIEW_MPCORE_RIRQ,
|
{
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.name = TYPE_REALVIEW_MPCORE_RIRQ,
|
||||||
.instance_size = sizeof(mpcore_rirq_state),
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_init = mpcore_rirq_init,
|
.instance_size = sizeof(mpcore_rirq_state),
|
||||||
.class_init = mpcore_rirq_class_init,
|
.instance_init = mpcore_rirq_init,
|
||||||
|
.class_init = mpcore_rirq_class_init,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void realview_mpcore_register_types(void)
|
DEFINE_TYPES(realview_mpcore_types)
|
||||||
{
|
|
||||||
type_register_static(&mpcore_rirq_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(realview_mpcore_register_types)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue