diff options
author | Igor Mammedov <imammedo@redhat.com> | 2015-02-18 19:14:21 +0000 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-02-26 13:04:11 +0100 |
commit | 295a515df0df655a902df6ebfc301096a3ee88ed (patch) | |
tree | f969dee4342b66a437658c94b3b311db0d6daed7 /hw/i386 | |
parent | 3c054bd51a132a69e5180f8c6ffa9d46724e4a50 (diff) |
acpi: add aml_int() term
* factor out ACPI const int packing out of build_append_value()
and rename build_append_value() to build_append_int_noprefix()
it will be reused for adding a plain integer value into AML.
will be used by is aml_processor() and CRS macro helpers
* extend build_append_int{_noprefix}() to support 64-bit values
it will be used PCI for generating 64bit _CRS entries
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | hw/i386/acpi-build.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index c66fe568c1..bf344151f5 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -304,14 +304,14 @@ static void build_append_and_cleanup_method(GArray *device, GArray *method) static void build_append_notify_target_ifequal(GArray *method, GArray *target_name, - uint32_t value, int size) + uint32_t value) { GArray *notify = build_alloc_array(); uint8_t op = 0xA0; /* IfOp */ build_append_byte(notify, 0x93); /* LEqualOp */ build_append_byte(notify, 0x68); /* Arg0Op */ - build_append_value(notify, value, size); + build_append_int(notify, value); build_append_byte(notify, 0x86); /* NotifyOp */ build_append_array(notify, target_name); build_append_byte(notify, 0x69); /* Arg1Op */ @@ -580,7 +580,7 @@ build_append_notify_method(GArray *device, const char *name, GArray *target = build_alloc_array(); build_append_namestring(target, format, i); assert(i < 256); /* Fits in 1 byte */ - build_append_notify_target_ifequal(method, target, i, 1); + build_append_notify_target_ifequal(method, target, i); build_free_array(target); } @@ -715,11 +715,11 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state) bus->parent_dev->devfn); build_append_byte(bus_table, 0x08); /* NameOp */ build_append_namestring(bus_table, "_SUN"); - build_append_value(bus_table, PCI_SLOT(bus->parent_dev->devfn), 1); + build_append_int(bus_table, PCI_SLOT(bus->parent_dev->devfn)); build_append_byte(bus_table, 0x08); /* NameOp */ build_append_namestring(bus_table, "_ADR"); - build_append_value(bus_table, (PCI_SLOT(bus->parent_dev->devfn) << 16) | - PCI_FUNC(bus->parent_dev->devfn), 4); + build_append_int(bus_table, (PCI_SLOT(bus->parent_dev->devfn) << 16) | + PCI_FUNC(bus->parent_dev->devfn)); } else { op = 0x10; /* ScopeOp */; build_append_namestring(bus_table, "PCI0"); |