acpi: arm/virt: build_spcr: use acpi_table_begin()/acpi_table_end() instead of build_...
commita86d86ac0ae39b7e8fcce08fffd2e0ab5aa287df
authorIgor Mammedov <imammedo@redhat.com>
Fri, 24 Sep 2021 12:27:58 +0000 (24 08:27 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 5 Oct 2021 21:30:57 +0000 (5 17:30 -0400)
tree0ca939a5b02b6d2bae396eee817629ab9160038e
parent88b1045eadd699335ffab0c9235f096f3a8cf771
acpi: arm/virt: build_spcr: use acpi_table_begin()/acpi_table_end() instead of build_header()

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.

while at it, replace packed structure with endian agnostic
build_append_FOO() API.

PS:
Spec is Microsoft hosted, however 1.02 is no where to be found
(MS lists only the current revision) and the current revision is 1.07,
so bring comments in line with 1.07 as this is the only available spec.
There is no content change between originally implemented 1.02
(using QEMU code as reference) and 1.07. The only change is renaming
'Reserved2' field to 'Language', with the same 0 value.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-Id: <20210924122802.1455362-32-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/arm/virt-acpi-build.c
include/hw/acpi/acpi-defs.h