[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/7] hw/mips/malta: Register the machine as a TypeInfo
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 2/7] hw/mips/malta: Register the machine as a TypeInfo |
Date: |
Tue, 30 Jun 2020 10:13:17 +0200 |
We want to add more machines. First convert from the old
DEFINE_MACHINE() API to the more recent DEFINE_TYPES(TypeInfo[])
one.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/mips/malta.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/hw/mips/malta.c b/hw/mips/malta.c
index 5b371c1e34..66172f0c82 100644
--- a/hw/mips/malta.c
+++ b/hw/mips/malta.c
@@ -70,6 +70,8 @@
#define MAX_IDE_BUS 2
+#define TYPE_MALTA_MACHINE MACHINE_TYPE_NAME("malta")
+
typedef struct {
MemoryRegion iomem;
MemoryRegion iomem_lo; /* 0 - 0x900 */
@@ -1433,8 +1435,10 @@ static void mips_malta_register_types(void)
type_init(mips_malta_register_types)
-static void mips_malta_machine_init(MachineClass *mc)
+static void malta_machine_class_init(ObjectClass *oc, void *data)
{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
mc->desc = "MIPS Malta Core LV";
mc->init = mips_malta_init;
mc->block_default_type = IF_IDE;
@@ -1448,4 +1452,16 @@ static void mips_malta_machine_init(MachineClass *mc)
mc->default_ram_id = "mips_malta.ram";
}
-DEFINE_MACHINE("malta", mips_malta_machine_init)
+static const TypeInfo malta_machine_types[] = {
+ {
+ .name = MACHINE_TYPE_NAME("malta"),
+ .parent = TYPE_MALTA_MACHINE,
+ }, {
+ .name = TYPE_MALTA_MACHINE,
+ .parent = TYPE_MACHINE,
+ .class_init = malta_machine_class_init,
+ .abstract = true,
+ }
+};
+
+DEFINE_TYPES(malta_machine_types)
--
2.21.3
- [PATCH 0/7] hw/mips/malta: Rework to allow more than 2GB of RAM on 64-bit, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH 3/7] hw/mips/malta: Rename 'malta' machine as 'malta-virt', Philippe Mathieu-Daudé, 2020/06/30
- [PATCH 2/7] hw/mips/malta: Register the machine as a TypeInfo,
Philippe Mathieu-Daudé <=
- [PATCH 1/7] hw/mips/malta: Trivial code movement, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH 4/7] hw/mips/malta: Introduce MaltaMachineClass::max_ramsize, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH 5/7] hw/mips/malta: Introduce the 'malta-phys' machine, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH 7/7] hw/mips/malta: Allow more than 2GB on 64-bit malta-virt, Philippe Mathieu-Daudé, 2020/06/30
- [PATCH 6/7] hw/mips/malta: Verify malta-phys machine uses correct DIMM sizes, Philippe Mathieu-Daudé, 2020/06/30
- Re: [PATCH 0/7] hw/mips/malta: Rework to allow more than 2GB of RAM on 64-bit, Aleksandar Markovic, 2020/06/30