diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-06-07 20:35:58 +0400 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-06-20 14:31:31 +0200 |
commit | 01b2ffcedd94ad7b42bc870e4c6936c87ad03429 (patch) | |
tree | 39bbadfbbaa229bfbda245840a256fe0132b2390 /hw/i386/acpi-build.c | |
parent | 58634047b7deeab36e4b07c4744e44d698975561 (diff) |
qapi: merge QInt and QFloat in QNum
We would like to use a same QObject type to represent numbers, whether
they are int, uint, or floats. Getters will allow some compatibility
between the various types if the number fits other representations.
Add a few more tests while at it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20170607163635.17635-7-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[parse_stats_intervals() simplified a bit, comment in
test_visitor_in_int_overflow() tidied up, suppress bogus warnings]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/i386/acpi-build.c')
-rw-r--r-- | hw/i386/acpi-build.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index ce74c84460..d7d2b65fe4 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -57,7 +57,6 @@ #include "hw/acpi/aml-build.h" -#include "qapi/qmp/qint.h" #include "qom/qom-qobject.h" #include "hw/i386/amd_iommu.h" #include "hw/i386/intel_iommu.h" @@ -150,21 +149,21 @@ static void acpi_get_pm_info(AcpiPmInfo *pm) /* Fill in optional s3/s4 related properties */ o = object_property_get_qobject(obj, ACPI_PM_PROP_S3_DISABLED, NULL); if (o) { - pm->s3_disabled = qint_get_int(qobject_to_qint(o)); + pm->s3_disabled = qnum_get_int(qobject_to_qnum(o)); } else { pm->s3_disabled = false; } qobject_decref(o); o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_DISABLED, NULL); if (o) { - pm->s4_disabled = qint_get_int(qobject_to_qint(o)); + pm->s4_disabled = qnum_get_int(qobject_to_qnum(o)); } else { pm->s4_disabled = false; } qobject_decref(o); o = object_property_get_qobject(obj, ACPI_PM_PROP_S4_VAL, NULL); if (o) { - pm->s4_val = qint_get_int(qobject_to_qint(o)); + pm->s4_val = qnum_get_int(qobject_to_qnum(o)); } else { pm->s4_val = false; } @@ -529,7 +528,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL, NULL); if (bsel) { - int64_t bsel_val = qint_get_int(qobject_to_qint(bsel)); + int64_t bsel_val = qnum_get_int(qobject_to_qnum(bsel)); aml_append(parent_scope, aml_name_decl("BSEL", aml_int(bsel_val))); notify_method = aml_method("DVNT", 2, AML_NOTSERIALIZED); @@ -639,7 +638,8 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, /* If bus supports hotplug select it and notify about local events */ if (bsel) { - int64_t bsel_val = qint_get_int(qobject_to_qint(bsel)); + int64_t bsel_val = qnum_get_int(qobject_to_qnum(bsel)); + aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM"))); aml_append(method, aml_call2("DVNT", aml_name("PCIU"), aml_int(1) /* Device Check */) @@ -2614,12 +2614,12 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg) if (!o) { return false; } - mcfg->mcfg_base = qint_get_int(qobject_to_qint(o)); + mcfg->mcfg_base = qnum_get_int(qobject_to_qnum(o)); qobject_decref(o); o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE, NULL); assert(o); - mcfg->mcfg_size = qint_get_int(qobject_to_qint(o)); + mcfg->mcfg_size = qnum_get_int(qobject_to_qnum(o)); qobject_decref(o); return true; } |