[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 07/35] acpi: acpi_build_hest: use acpi_table_begin()/acpi_
From: |
Eric Auger |
Subject: |
Re: [PATCH v3 07/35] acpi: acpi_build_hest: use acpi_table_begin()/acpi_table_end() instead of build_header() |
Date: |
Mon, 20 Sep 2021 18:27:01 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 9/7/21 4:47 PM, Igor Mammedov wrote:
> 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: Dongjiu Geng <gengdongjiu1@gmail.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Eric
> ---
> v3:
> * s/acpi_init_table|acpi_table_composed/acpi_table_begin|acpi_table_end/
>
> CC: qemu-arm@nongnu.org
> CC: drjones@redhat.com
> CC: gengdongjiu1@gmail.com
> CC: eauger@redhat.com
> ---
> hw/acpi/ghes.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c
> index a749b84d62..45d9a809cc 100644
> --- a/hw/acpi/ghes.c
> +++ b/hw/acpi/ghes.c
> @@ -362,18 +362,16 @@ static void build_ghes_v2(GArray *table_data, int
> source_id, BIOSLinker *linker)
> void acpi_build_hest(GArray *table_data, BIOSLinker *linker,
> const char *oem_id, const char *oem_table_id)
> {
> - uint64_t hest_start = table_data->len;
> + AcpiTable table = { .sig = "HEST", .rev = 1,
> + .oem_id = oem_id, .oem_table_id = oem_table_id };
>
> - /* Hardware Error Source Table header*/
> - acpi_data_push(table_data, sizeof(AcpiTableHeader));
> + acpi_table_begin(&table, table_data);
>
> /* Error Source Count */
> build_append_int_noprefix(table_data, ACPI_GHES_ERROR_SOURCE_COUNT, 4);
> -
> build_ghes_v2(table_data, ACPI_HEST_SRC_ID_SEA, linker);
>
> - build_header(linker, table_data, (void *)(table_data->data + hest_start),
> - "HEST", table_data->len - hest_start, 1, oem_id,
> oem_table_id);
> + acpi_table_end(linker, &table);
> }
>
> void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s,
>
- Re: [PATCH v3 02/35] acpi: build_rsdt: use acpi_table_begin()/acpi_table_end() instead of build_header(), (continued)
- [PATCH v3 04/35] acpi: build_slit: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- [PATCH v3 03/35] acpi: build_xsdt: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- [PATCH v3 06/35] acpi: build_tpm2: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- [PATCH v3 05/35] acpi: build_fadt: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- [PATCH v3 07/35] acpi: acpi_build_hest: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- Re: [PATCH v3 07/35] acpi: acpi_build_hest: use acpi_table_begin()/acpi_table_end() instead of build_header(),
Eric Auger <=
- [PATCH v3 08/35] acpi: build_mcfg: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- [PATCH v3 09/35] acpi: build_hmat: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- [PATCH v3 10/35] acpi: nvdimm_build_nfit: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- [PATCH v3 11/35] acpi: nvdimm_build_ssdt: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07
- [PATCH v3 12/35] acpi: vmgenid_build_acpi: use acpi_table_begin()/acpi_table_end() instead of build_header(), Igor Mammedov, 2021/09/07