- AcpiRsdpDescriptor *rsdp_table = &data->rsdp_table;
- uint32_t addr = data->rsdp_addr;
-
- acpi_parse_rsdp_table(addr, rsdp_table);
-
- /* rsdp checksum is not for the whole table, but for the first 20 bytes */
- g_assert(!acpi_calc_checksum((uint8_t *)rsdp_table, 20));
-}
-
-static void test_acpi_rsdt_table(test_data *data)
-{
- AcpiRsdtDescriptorRev1 *rsdt_table = &data->rsdt_table;
- uint32_t addr = le32_to_cpu(data->rsdp_table.rsdt_physical_address);
- uint32_t *tables;
- int tables_nr;
- uint8_t checksum;
- uint32_t rsdt_table_length;
-
- /* read the header */
- ACPI_READ_TABLE_HEADER(rsdt_table, addr);
- ACPI_ASSERT_CMP(rsdt_table->signature, "RSDT");
-
- rsdt_table_length = le32_to_cpu(rsdt_table->length);
-
- /* compute the table entries in rsdt */
- tables_nr = (rsdt_table_length - sizeof(AcpiRsdtDescriptorRev1)) /
- sizeof(uint32_t);
- g_assert(tables_nr > 0);
-
- /* get the addresses of the tables pointed by rsdt */
- tables = g_new0(uint32_t, tables_nr);
- ACPI_READ_ARRAY_PTR(tables, tables_nr, addr);
-
- checksum = acpi_calc_checksum((uint8_t *)rsdt_table, rsdt_table_length) +
- acpi_calc_checksum((uint8_t *)tables,
- tables_nr * sizeof(uint32_t));
- g_assert(!checksum);
-
- /* SSDT tables after FADT */
- data->rsdt_tables_addr = tables;
- data->rsdt_tables_nr = tables_nr;
+ g_free(table->aml);
+ if (table->aml_file &&
+ !table->tmp_files_retain &&
+ g_strstr_len(table->aml_file, -1, "aml-")) {
+ unlink(table->aml_file);
+ }
+ g_free(table->aml_file);
+ g_free(table->asl);
+ if (table->asl_file &&
+ !table->tmp_files_retain) {
+ unlink(table->asl_file);
+ }
+ g_free(table->asl_file);