diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-11-11 13:38:18 -0500 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-12-15 10:02:07 -0500 |
commit | 85cc807cbc48055c92c187a3dc97c1c5d85de39f (patch) | |
tree | 4c9e2a9ce9faef5a415c5893ee891839992e9dc9 | |
parent | 27edeeaafe439d0f58d9ff464a97ec418293d0b7 (diff) | |
download | qemu-85cc807cbc48055c92c187a3dc97c1c5d85de39f.zip qemu-85cc807cbc48055c92c187a3dc97c1c5d85de39f.tar.gz qemu-85cc807cbc48055c92c187a3dc97c1c5d85de39f.tar.bz2 |
arm/cpu64: Register "aarch64" 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: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20201111183823.283752-8-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r-- | target/arm/cpu64.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 6492130..7cf9fc4 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -762,15 +762,6 @@ static void aarch64_cpu_set_aarch64(Object *obj, bool value, Error **errp) } } -static void aarch64_cpu_initfn(Object *obj) -{ - object_property_add_bool(obj, "aarch64", aarch64_cpu_get_aarch64, - aarch64_cpu_set_aarch64); - object_property_set_description(obj, "aarch64", - "Set on/off to enable/disable aarch64 " - "execution state "); -} - static void aarch64_cpu_finalizefn(Object *obj) { } @@ -790,6 +781,12 @@ static void aarch64_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_num_core_regs = 34; cc->gdb_core_xml_file = "aarch64-core.xml"; cc->gdb_arch_name = aarch64_gdb_arch_name; + + object_class_property_add_bool(oc, "aarch64", aarch64_cpu_get_aarch64, + aarch64_cpu_set_aarch64); + object_class_property_set_description(oc, "aarch64", + "Set on/off to enable/disable aarch64 " + "execution state "); } static void aarch64_cpu_instance_init(Object *obj) @@ -827,7 +824,6 @@ static const TypeInfo aarch64_cpu_type_info = { .name = TYPE_AARCH64_CPU, .parent = TYPE_ARM_CPU, .instance_size = sizeof(ARMCPU), - .instance_init = aarch64_cpu_initfn, .instance_finalize = aarch64_cpu_finalizefn, .abstract = true, .class_size = sizeof(AArch64CPUClass), |