Skip to content

Commit

Permalink
sifive_e: Register "revb" as class property
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ehabkost committed Sep 22, 2020
1 parent 53f6474 commit fabbcbd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions hw/riscv/sifive_e.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 = {
Expand Down

0 comments on commit fabbcbd

Please sign in to comment.