aboutsummaryrefslogtreecommitdiff
path: root/tests/bios-tables-test.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2018-12-27 15:13:32 +0100
committerMichael S. Tsirkin <mst@redhat.com>2019-01-17 21:10:57 -0500
commit3314778d8834a9c446b14b340dbb0fdf07d01975 (patch)
treefafe2e98175f46b81d0be1267b9207723b3a55cc /tests/bios-tables-test.c
parentacee774b3dbeb7fcd294b1f96c1a286d39d9b495 (diff)
tests: smbios: fetch whole table in one step instead of reading it step by step
replace a bunch of ACPI_READ_ARRAY/ACPI_READ_FIELD macro, that read SMBIOS table field by field with one memread() to fetch whole table at once and drop no longer used ACPI_READ_ARRAY/ACPI_READ_FIELD macro. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests/bios-tables-test.c')
-rw-r--r--tests/bios-tables-test.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 3f9830fe7f..c0b4e9a1aa 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -408,32 +408,19 @@ static bool smbios_ep_table_ok(test_data *data)
struct smbios_21_entry_point *ep_table = &data->smbios_ep_table;
uint32_t addr = data->smbios_ep_addr;
- ACPI_READ_ARRAY(data->qts, ep_table->anchor_string, addr);
+ qtest_memread(data->qts, addr, ep_table, sizeof(*ep_table));
if (memcmp(ep_table->anchor_string, "_SM_", 4)) {
return false;
}
- ACPI_READ_FIELD(data->qts, ep_table->checksum, addr);
- ACPI_READ_FIELD(data->qts, ep_table->length, addr);
- ACPI_READ_FIELD(data->qts, ep_table->smbios_major_version, addr);
- ACPI_READ_FIELD(data->qts, ep_table->smbios_minor_version, addr);
- ACPI_READ_FIELD(data->qts, ep_table->max_structure_size, addr);
- ACPI_READ_FIELD(data->qts, ep_table->entry_point_revision, addr);
- ACPI_READ_ARRAY(data->qts, ep_table->formatted_area, addr);
- ACPI_READ_ARRAY(data->qts, ep_table->intermediate_anchor_string, addr);
if (memcmp(ep_table->intermediate_anchor_string, "_DMI_", 5)) {
return false;
}
- ACPI_READ_FIELD(data->qts, ep_table->intermediate_checksum, addr);
- ACPI_READ_FIELD(data->qts, ep_table->structure_table_length, addr);
if (ep_table->structure_table_length == 0) {
return false;
}
- ACPI_READ_FIELD(data->qts, ep_table->structure_table_address, addr);
- ACPI_READ_FIELD(data->qts, ep_table->number_of_structures, addr);
if (ep_table->number_of_structures == 0) {
return false;
}
- ACPI_READ_FIELD(data->qts, ep_table->smbios_bcd_revision, addr);
if (acpi_calc_checksum((uint8_t *)ep_table, sizeof *ep_table) ||
acpi_calc_checksum((uint8_t *)ep_table + 0x10,
sizeof *ep_table - 0x10)) {