mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
hw: acpi: Remove AcpiRsdpDescriptor and fix tests
The only remaining AcpiRsdpDescriptor users are the ACPI utils for the BIOS table tests. We remove that dependency and can thus remove the structure itself. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
a46ce1c26d
commit
d6caf3631c
5 changed files with 63 additions and 32 deletions
|
@ -27,7 +27,7 @@ typedef struct {
|
|||
const char *machine;
|
||||
const char *variant;
|
||||
uint32_t rsdp_addr;
|
||||
AcpiRsdpDescriptor rsdp_table;
|
||||
uint8_t rsdp_table[36 /* ACPI 2.0+ RSDP size */];
|
||||
AcpiRsdtDescriptorRev1 rsdt_table;
|
||||
uint32_t dsdt_addr;
|
||||
uint32_t facs_addr;
|
||||
|
@ -86,19 +86,31 @@ static void test_acpi_rsdp_address(test_data *data)
|
|||
|
||||
static void test_acpi_rsdp_table(test_data *data)
|
||||
{
|
||||
AcpiRsdpDescriptor *rsdp_table = &data->rsdp_table;
|
||||
uint8_t *rsdp_table = data->rsdp_table, revision;
|
||||
uint32_t addr = data->rsdp_addr;
|
||||
|
||||
acpi_parse_rsdp_table(data->qts, addr, rsdp_table);
|
||||
revision = rsdp_table[15 /* Revision offset */];
|
||||
|
||||
/* rsdp checksum is not for the whole table, but for the first 20 bytes */
|
||||
g_assert(!acpi_calc_checksum((uint8_t *)rsdp_table, 20));
|
||||
switch (revision) {
|
||||
case 0: /* ACPI 1.0 RSDP */
|
||||
/* With rev 1, checksum is only for the first 20 bytes */
|
||||
g_assert(!acpi_calc_checksum(rsdp_table, 20));
|
||||
break;
|
||||
case 2: /* ACPI 2.0+ RSDP */
|
||||
/* With revision 2, we have 2 checksums */
|
||||
g_assert(!acpi_calc_checksum(rsdp_table, 20));
|
||||
g_assert(!acpi_calc_checksum(rsdp_table, 36));
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
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 addr = acpi_get_rsdt_address(data->rsdp_table);
|
||||
uint32_t *tables;
|
||||
int tables_nr;
|
||||
uint8_t checksum;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue