summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel.a@redhat.com>2013-11-21 21:33:21 +0200
committerMichael S. Tsirkin <mst@redhat.com>2013-12-11 20:11:09 +0200
commit15650602195be9f2957818318457c5d5096ff4c2 (patch)
treec4e68cc55bcb8f3a2cf346019f190cd134a705f1 /tests
parent53cb28cbfea038f8ad50132dc8a684e638c7d48b (diff)
downloadqemu-15650602195be9f2957818318457c5d5096ff4c2.tar.gz
qemu-15650602195be9f2957818318457c5d5096ff4c2.tar.bz2
qemu-15650602195be9f2957818318457c5d5096ff4c2.zip
acpi unit-test: load and check facs table
FACS table does not have a checksum, so we can check at least the signature (existence). Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/acpi-test.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/acpi-test.c b/tests/acpi-test.c
index d6ff66f7d8..43775cd5ad 100644
--- a/tests/acpi-test.c
+++ b/tests/acpi-test.c
@@ -30,6 +30,7 @@ typedef struct {
AcpiRsdpDescriptor rsdp_table;
AcpiRsdtDescriptorRev1 rsdt_table;
AcpiFadtDescriptorRev1 fadt_table;
+ AcpiFacsDescriptorRev1 facs_table;
uint32_t *rsdt_tables_addr;
int rsdt_tables_nr;
AcpiSdtTable dsdt_table;
@@ -252,6 +253,22 @@ static void test_acpi_fadt_table(test_data *data)
g_assert(!acpi_checksum((uint8_t *)fadt_table, fadt_table->length));
}
+static void test_acpi_facs_table(test_data *data)
+{
+ AcpiFacsDescriptorRev1 *facs_table = &data->facs_table;
+ uint32_t addr = data->fadt_table.firmware_ctrl;
+
+ ACPI_READ_FIELD(facs_table->signature, addr);
+ ACPI_READ_FIELD(facs_table->length, addr);
+ ACPI_READ_FIELD(facs_table->hardware_signature, addr);
+ ACPI_READ_FIELD(facs_table->firmware_waking_vector, addr);
+ ACPI_READ_FIELD(facs_table->global_lock, addr);
+ ACPI_READ_FIELD(facs_table->flags, addr);
+ ACPI_READ_ARRAY(facs_table->resverved3, addr);
+
+ g_assert_cmphex(facs_table->signature, ==, ACPI_FACS_SIGNATURE);
+}
+
static void test_dst_table(AcpiSdtTable *sdt_table, uint32_t addr)
{
uint8_t checksum;
@@ -329,6 +346,7 @@ static void test_acpi_one(const char *params)
test_acpi_rsdp_table(&data);
test_acpi_rsdt_table(&data);
test_acpi_fadt_table(&data);
+ test_acpi_facs_table(data);
test_acpi_dsdt_table(&data);
test_acpi_ssdt_tables(&data);