From 4b14d543f3338985fd9c74ae6f6a6d3861c841dd Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Thu, 2 May 2019 16:51:50 +0200 Subject: tests: acpi: make acpi_fetch_table() take size of fetched table pointer Currently acpi_fetch_table() assumes 32 bit size of table pointer in ACPI tables. However X_foo variants are 64 bit, prepare acpi_fetch_table() to handle both by adding an argument for addr_ptr pointed entry size. Follow up commits will use that to read XSDT and X_foo entries in ACPI tables. Signed-off-by: Igor Mammedov Message-Id: <1556808723-226478-3-git-send-email-imammedo@redhat.com> Reviewed-by: Wei Yang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/bios-tables-test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/bios-tables-test.c') diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 6a678bf761..86b592c67f 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -114,14 +114,14 @@ static void test_acpi_rsdt_table(test_data *data) /* read RSDT table */ acpi_fetch_table(data->qts, &rsdt.aml, &rsdt.aml_len, - &data->rsdp_table[16 /* RsdtAddress */], "RSDT", true); + &data->rsdp_table[16 /* RsdtAddress */], 4, "RSDT", true); /* Load all tables and add to test list directly RSDT referenced tables */ ACPI_FOREACH_RSDT_ENTRY(rsdt.aml, rsdt.aml_len, ent, 4 /* Entry size */) { AcpiSdtTable ssdt_table = {}; acpi_fetch_table(data->qts, &ssdt_table.aml, &ssdt_table.aml_len, ent, - NULL, true); + 4, NULL, true); /* Add table to ASL test tables list */ g_array_append_val(data->tables, ssdt_table); } @@ -139,11 +139,11 @@ static void test_acpi_fadt_table(test_data *data) /* Since DSDT/FACS isn't in RSDT, add them to ASL test list manually */ acpi_fetch_table(data->qts, &table.aml, &table.aml_len, - fadt_aml + 36 /* FIRMWARE_CTRL */, "FACS", false); + fadt_aml + 36 /* FIRMWARE_CTRL */, 4, "FACS", false); g_array_append_val(data->tables, table); acpi_fetch_table(data->qts, &table.aml, &table.aml_len, - fadt_aml + 40 /* DSDT */, "DSDT", true); + fadt_aml + 40 /* DSDT */, 4, "DSDT", true); g_array_append_val(data->tables, table); memset(fadt_aml + 36, 0, 4); /* sanitize FIRMWARE_CTRL ptr */ -- cgit 1.4.1