[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/11] hw/arm/integratorcp: Define machine as generic QOM type
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 06/11] hw/arm/integratorcp: Define machine as generic QOM type |
Date: |
Fri, 18 Apr 2025 01:58:09 +0200 |
While DEFINE_MACHINE() is a succinct macro, it doesn't
allow registering QOM interfaces to the defined machine.
Convert to the generic DEFINE_TYPES() in preparation to
register interfaces.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/arm/integratorcp.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index ac0c6c60961..f95916b517d 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -681,8 +681,10 @@ static void integratorcp_init(MachineState *machine)
arm_load_kernel(cpu, machine, &integrator_binfo);
}
-static void integratorcp_machine_init(MachineClass *mc)
+static void integratorcp_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "ARM Integrator/CP (ARM926EJ-S)";
mc->init = integratorcp_init;
mc->ignore_memory_transaction_failures = true;
@@ -693,8 +695,6 @@ static void integratorcp_machine_init(MachineClass *mc)
machine_add_audiodev_property(mc);
}
-DEFINE_MACHINE("integratorcp", integratorcp_machine_init)
-
static const Property core_properties[] = {
DEFINE_PROP_UINT32("memsz", IntegratorCMState, memsz, 0),
};
@@ -754,3 +754,13 @@ static void integratorcp_register_types(void)
}
type_init(integratorcp_register_types)
+
+static const TypeInfo integratorcp_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("integratorcp"),
+ .parent = TYPE_MACHINE,
+ .class_init = integratorcp_machine_class_init,
+ },
+};
+
+DEFINE_TYPES(integratorcp_machine_types)
--
2.47.1
- [PATCH 00/11] hw/arm: Define machines as generic QOM types, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 01/11] hw/core/null-machine: Define machine as generic QOM type, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 02/11] hw/arm/bananapi: Define machine as generic QOM type, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 03/11] hw/arm/cubieboard: Define machine as generic QOM type, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 04/11] hw/arm/digic: Define machine as generic QOM type, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 05/11] hw/arm/imx: Define machines as generic QOM types, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 06/11] hw/arm/integratorcp: Define machine as generic QOM type,
Philippe Mathieu-Daudé <=
- [PATCH 07/11] hw/arm/kzm: Define machine as generic QOM type, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 08/11] hw/arm/msf2: Define machine as generic QOM type, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 09/11] hw/arm/musicpal: Define machine as generic QOM type, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 10/11] hw/arm/orangepi: Define machine as generic QOM type, Philippe Mathieu-Daudé, 2025/04/17
- [PATCH 11/11] hw/arm/stm32: Define machines as generic QOM types, Philippe Mathieu-Daudé, 2025/04/17
- Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types, Pierrick Bouvier, 2025/04/17
- Re: [PATCH 00/11] hw/arm: Define machines as generic QOM types, BALATON Zoltan, 2025/04/18