Read in the entire RSDP but only run the standard checksum over the
version 1 header. Add comments to explain what we're doing here better. Reported by: Alex Vasylenko <lxv@omut.org>
This commit is contained in:
parent
9049715ff9
commit
2ff84d1485
@ -96,19 +96,24 @@ static struct ACPIrsdp *
|
||||
acpi_get_rsdp(u_long addr)
|
||||
{
|
||||
struct ACPIrsdp rsdp;
|
||||
size_t len;
|
||||
|
||||
/* Read in the table signature and check it. */
|
||||
pread(acpi_mem_fd, &rsdp, 8, addr);
|
||||
if (memcmp(rsdp.signature, "RSD PTR ", 8))
|
||||
return (NULL);
|
||||
|
||||
/* Read the entire table. */
|
||||
len = sizeof(rsdp);
|
||||
pread(acpi_mem_fd, &rsdp, len, addr);
|
||||
if (acpi_checksum(&rsdp, len))
|
||||
pread(acpi_mem_fd, &rsdp, sizeof(rsdp), addr);
|
||||
|
||||
/* Run the checksum only over the version 1 header. */
|
||||
if (acpi_checksum(&rsdp, 20))
|
||||
return (NULL);
|
||||
if (rsdp.revision > 0)
|
||||
len = rsdp.length;
|
||||
return (acpi_map_physical(addr, len));
|
||||
if (rsdp.revision == 0)
|
||||
return (NULL);
|
||||
|
||||
/* XXX Should handle ACPI 2.0 RSDP extended checksum here. */
|
||||
|
||||
return (acpi_map_physical(addr, rsdp.length));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user