summaryrefslogtreecommitdiffstats
path: root/hw/riscv/sifive_e.c
diff options
context:
space:
mode:
authorEduardo Habkost2020-09-22 00:10:44 +0200
committerEduardo Habkost2020-09-22 22:48:29 +0200
commitfabbcbd95325a3420ce7d48c1b980ae079ea7dbf (patch)
treeda12560a93a5a9951ecfa4911dd20d28318f7d22 /hw/riscv/sifive_e.c
parenti440fx: Register i440FX-pcihost properties as class properties (diff)
downloadqemu-fabbcbd95325a3420ce7d48c1b980ae079ea7dbf.tar.gz
qemu-fabbcbd95325a3420ce7d48c1b980ae079ea7dbf.tar.xz
qemu-fabbcbd95325a3420ce7d48c1b980ae079ea7dbf.zip
sifive_e: Register "revb" as class property
Class properties make QOM introspection simpler and easier, as they don't require an object to be instantiated. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20200921221045.699690-24-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/riscv/sifive_e.c')
-rw-r--r--hw/riscv/sifive_e.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index 759059cd7b..fcfac16816 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -137,11 +137,6 @@ static void sifive_e_machine_instance_init(Object *obj)
SiFiveEState *s = RISCV_E_MACHINE(obj);
s->revb = false;
- object_property_add_bool(obj, "revb", sifive_e_machine_get_revb,
- sifive_e_machine_set_revb);
- object_property_set_description(obj, "revb",
- "Set on to tell QEMU that it should model "
- "the revB HiFive1 board");
}
static void sifive_e_machine_class_init(ObjectClass *oc, void *data)
@@ -152,6 +147,12 @@ static void sifive_e_machine_class_init(ObjectClass *oc, void *data)
mc->init = sifive_e_machine_init;
mc->max_cpus = 1;
mc->default_cpu_type = SIFIVE_E_CPU;
+
+ object_class_property_add_bool(oc, "revb", sifive_e_machine_get_revb,
+ sifive_e_machine_set_revb);
+ object_class_property_set_description(oc, "revb",
+ "Set on to tell QEMU that it should model "
+ "the revB HiFive1 board");
}
static const TypeInfo sifive_e_machine_typeinfo = {