We already know the rsdt length in advance,
so map the whole table without freeing and remapping later git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42105 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -46,23 +46,17 @@ acpi_check_rsdt(acpi_rsdp* rsdp)
|
|||||||
// map and validate the root system description table
|
// map and validate the root system description table
|
||||||
acpi_descriptor_header* rsdt
|
acpi_descriptor_header* rsdt
|
||||||
= (acpi_descriptor_header*)mmu_map_physical_memory(
|
= (acpi_descriptor_header*)mmu_map_physical_memory(
|
||||||
rsdp->rsdt_address, sizeof(acpi_descriptor_header),
|
rsdp->rsdt_address, rsdp->rsdt_length,
|
||||||
kDefaultPageFlags);
|
kDefaultPageFlags);
|
||||||
if (rsdt == NULL
|
if (rsdt == NULL
|
||||||
|| strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) {
|
|| strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) {
|
||||||
if (rsdt != NULL)
|
if (rsdt != NULL)
|
||||||
mmu_free(rsdt, sizeof(acpi_descriptor_header));
|
mmu_free(rsdt, rsdp->rsdt_length);
|
||||||
TRACE(("acpi: invalid root system description table\n"));
|
TRACE(("acpi: invalid root system description table\n"));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map the whole table, not just the header
|
sAcpiRsdt = rsdt;
|
||||||
uint32 length = rsdt->length;
|
|
||||||
TRACE(("acpi: rsdt length: %lu\n", length));
|
|
||||||
mmu_free(rsdt, sizeof(acpi_descriptor_header));
|
|
||||||
|
|
||||||
sAcpiRsdt = (acpi_descriptor_header*)mmu_map_physical_memory(rsdp->rsdt_address,
|
|
||||||
length, kDefaultPageFlags);
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user