[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/6] target-ppc: Convert PReP to machine class
From: |
David Gibson |
Subject: |
[Qemu-devel] [PATCH 4/6] target-ppc: Convert PReP to machine class |
Date: |
Fri, 6 Mar 2015 15:18:24 +1100 |
The more commonly used ppc machine types: spapr, and newworld Mac have
already been converted to the newer MachineClass representation, but some
others still use QEMUMachine.
This patch cleans things up slightly, by converting the "prep" machine
type to the new style.
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/prep.c | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 15df7f3..dfc8689 100644
--- a/hw/ppc/prep.c
+++ b/hw/ppc/prep.c
@@ -44,6 +44,8 @@
#include "exec/address-spaces.h"
#include "elf.h"
+#define TYPE_PREP_MACHINE "PReP-machine"
+
//#define HARD_DEBUG_PPC_IO
//#define DEBUG_PPC_IO
@@ -561,17 +563,27 @@ static void ppc_prep_init(MachineState *machine)
graphic_width, graphic_height, graphic_depth);
}
-static QEMUMachine prep_machine = {
- .name = "prep",
- .desc = "PowerPC PREP platform",
- .init = ppc_prep_init,
- .max_cpus = MAX_CPUS,
- .default_boot_order = "cad",
+static void prep_machine_class_init(ObjectClass *oc, void *data)
+{
+ MachineClass *mc = MACHINE_CLASS(oc);
+
+ mc->name = "prep";
+ mc->desc = "PowerPC PREP platform";
+ mc->init = ppc_prep_init;
+ mc->max_cpus = MAX_CPUS;
+ mc->default_boot_order = "cad";
+}
+
+static const TypeInfo prep_machine_info = {
+ .name = TYPE_PREP_MACHINE,
+ .parent = TYPE_MACHINE,
+ .instance_size = sizeof(MachineState),
+ .class_init = prep_machine_class_init,
};
-static void prep_machine_init(void)
+static void prep_machine_register_types(void)
{
- qemu_register_machine(&prep_machine);
+ type_register_static(&prep_machine_info);
}
-machine_init(prep_machine_init);
+type_init(prep_machine_register_types)
--
2.1.0
[Qemu-devel] [PATCH 1/6] Split serial-isa into its own config option, David Gibson, 2015/03/05
[Qemu-devel] [PATCH 4/6] target-ppc: Convert PReP to machine class,
David Gibson <=
[Qemu-devel] [PATCH 3/6] pc: Use MachineClass callbacks for "irq" and "pic" hmp commands, David Gibson, 2015/03/05
Re: [Qemu-devel] [PATCH 0/6] Clean up ISA dependencies so we make ISA optional to build, Alexander Graf, 2015/03/06
Re: [Qemu-devel] [PATCH 0/6] Clean up ISA dependencies so we make ISA optional to build, Michael S. Tsirkin, 2015/03/10