[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 27/57] acpi: x86: build_dsdt: use acpi_table_begin()/acpi_table_en
From: |
Michael S. Tsirkin |
Subject: |
[PULL 27/57] acpi: x86: build_dsdt: use acpi_table_begin()/acpi_table_end() instead of build_header() |
Date: |
Tue, 5 Oct 2021 12:02:32 -0400 |
From: Igor Mammedov <imammedo@redhat.com>
it replaces error-prone pointer arithmetic for build_header() API,
with 2 calls to start and finish table creation,
which hides offsets magic from API user.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-Id: <20210924122802.1455362-14-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/acpi-build.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index f4d6ae3d02..e17451bc6d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1405,12 +1405,12 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
#endif
int i;
VMBusBridge *vmbus_bridge = vmbus_bridge_find();
+ AcpiTable table = { .sig = "DSDT", .rev = 1, .oem_id = x86ms->oem_id,
+ .oem_table_id = x86ms->oem_table_id };
+ acpi_table_begin(&table, table_data);
dsdt = init_aml_allocator();
- /* Reserve space for header */
- acpi_data_push(dsdt->buf, sizeof(AcpiTableHeader));
-
build_dbg_aml(dsdt);
if (misc->is_piix4) {
sb_scope = aml_scope("_SB");
@@ -1867,9 +1867,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
/* copy AML table into ACPI tables blob and patch header there */
g_array_append_vals(table_data, dsdt->buf->data, dsdt->buf->len);
- build_header(linker, table_data,
- (void *)(table_data->data + table_data->len - dsdt->buf->len),
- "DSDT", dsdt->buf->len, 1, x86ms->oem_id,
x86ms->oem_table_id);
+ acpi_table_end(linker, &table);
free_aml_allocator();
}
--
MST
- [PULL 45/57] acpi: arm/virt: build_spcr: use acpi_table_begin()/acpi_table_end() instead of build_header(), (continued)
- [PULL 45/57] acpi: arm/virt: build_spcr: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 49/57] acpi: AcpiGenericAddress no longer used to map/access fields of MMIO, drop packed attribute, Michael S. Tsirkin, 2021/10/05
- [PULL 51/57] hw/i386/acpi: fix conflicting IO address range for acpi pci hotplug in q35, Michael S. Tsirkin, 2021/10/05
- [PULL 56/57] hw/i386/amd_iommu: Rename SysBus specific functions as amdvi_sysbus_X(), Michael S. Tsirkin, 2021/10/05
- [PULL 22/57] acpi: build_mcfg: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- [PULL 55/57] hw/i386/amd_iommu: Rename amdviPCI TypeInfo, Michael S. Tsirkin, 2021/10/05
- [PULL 53/57] virtio-balloon: Fix page-poison subsection name, Michael S. Tsirkin, 2021/10/05
- [PULL 54/57] nvdimm: release the correct device list, Michael S. Tsirkin, 2021/10/05
- [PULL 52/57] bios-tables-test: Update ACPI DSDT table golden blobs for q35, Michael S. Tsirkin, 2021/10/05
- [PULL 57/57] hw/i386/amd_iommu: Add description/category to TYPE_AMD_IOMMU_PCI, Michael S. Tsirkin, 2021/10/05
- [PULL 27/57] acpi: x86: build_dsdt: use acpi_table_begin()/acpi_table_end() instead of build_header(),
Michael S. Tsirkin <=
- [PULL 33/57] acpi: build_waet: use acpi_table_begin()/acpi_table_end() instead of build_header(), Michael S. Tsirkin, 2021/10/05
- Re: [PULL 00/57] pc,pci,virtio: features, fixes, Richard Henderson, 2021/10/05
- Re: [PULL 00/57] pc,pci,virtio: features, fixes, Michael S. Tsirkin, 2021/10/05
- Re: [PULL 00/57] pc,pci,virtio: features, fixes, Richard Henderson, 2021/10/05
- Re: [PULL 00/57] pc,pci,virtio: features, fixes, Jason Wang, 2021/10/10