aboutsummaryrefslogtreecommitdiff
path: root/tests/acpi-utils.h
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2018-12-27 15:13:27 +0100
committerMichael S. Tsirkin <mst@redhat.com>2019-01-14 19:31:04 -0500
commit81eb530db4ce24b7cc3cd8303505a8053ee1b6cc (patch)
tree28f0467c3d7f2f94c369d54b097a5817b96097ec /tests/acpi-utils.h
parentda93b82079dcb43885a84bc25b746fd15ae29dfb (diff)
tests: acpi: use AcpiSdtTable::aml in consistent way
Currently in the 1st case we store table body fetched from QEMU in AcpiSdtTable::aml minus it's header but in the 2nd case when we load reference aml from disk, it holds whole blob including header. More over in the 1st case, we read header in separate AcpiSdtTable::header structure and then jump over hoops to fixup tables and combine both. Treat AcpiSdtTable::aml as whole table blob approach in both cases and when fetching tables from QEMU, first get table length and then fetch whole table into AcpiSdtTable::aml instead if doing it field by field. As result * AcpiSdtTable::aml is used in consistent manner * FADT fixups use offsets from spec instead of being shifted by header length * calculating checksums and dumping blobs becomes simpler Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests/acpi-utils.h')
-rw-r--r--tests/acpi-utils.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/acpi-utils.h b/tests/acpi-utils.h
index c5b0e12aa2..1b0e80d45c 100644
--- a/tests/acpi-utils.h
+++ b/tests/acpi-utils.h
@@ -18,8 +18,10 @@
/* DSDT and SSDTs format */
typedef struct {
- AcpiTableHeader header;
- gchar *aml; /* aml bytecode from guest */
+ union {
+ AcpiTableHeader *header;
+ uint8_t *aml; /* aml bytecode from guest */
+ };
gsize aml_len;
gchar *aml_file;
gchar *asl; /* asl code generated from aml */