mirror of https://github.com/xemu-project/xemu.git
hw/riscv/opentitan: Declare 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. Replace the type_init() / type_register_static() combination. This is in preparation of adding the OpenTitan machine type to this array in a pair of commits. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Message-Id: <20230520054510.68822-3-philmd@linaro.org> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
9b29697fef
commit
e0782b11bd
|
@ -320,17 +320,14 @@ static void lowrisc_ibex_soc_class_init(ObjectClass *oc, void *data)
|
||||||
dc->user_creatable = false;
|
dc->user_creatable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo lowrisc_ibex_soc_type_info = {
|
static const TypeInfo open_titan_types[] = {
|
||||||
|
{
|
||||||
.name = TYPE_RISCV_IBEX_SOC,
|
.name = TYPE_RISCV_IBEX_SOC,
|
||||||
.parent = TYPE_DEVICE,
|
.parent = TYPE_DEVICE,
|
||||||
.instance_size = sizeof(LowRISCIbexSoCState),
|
.instance_size = sizeof(LowRISCIbexSoCState),
|
||||||
.instance_init = lowrisc_ibex_soc_init,
|
.instance_init = lowrisc_ibex_soc_init,
|
||||||
.class_init = lowrisc_ibex_soc_class_init,
|
.class_init = lowrisc_ibex_soc_class_init,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void lowrisc_ibex_soc_register_types(void)
|
DEFINE_TYPES(open_titan_types)
|
||||||
{
|
|
||||||
type_register_static(&lowrisc_ibex_soc_type_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
type_init(lowrisc_ibex_soc_register_types)
|
|
||||||
|
|
Loading…
Reference in New Issue