MFC: Properly handle ACPI table headers that cross a page boundary when

looking for the MADT during early boot.
This commit is contained in:
jhb 2008-02-12 19:20:10 +00:00
parent 9d35afcf34
commit c6cf595ecb
2 changed files with 14 additions and 10 deletions

View File

@ -106,9 +106,11 @@ static struct apic_enumerator madt_enumerator = {
/*
* Code to abuse the crashdump map to map in the tables for the early
* probe. We cheat and make the following assumptions about how we
* use this KVA: page 0 is used to map in the first page of each table
* found via the RSDT or XSDT and pages 1 to n are used to map in the
* RSDT or XSDT. The offset is in pages; the length is in bytes.
* use this KVA: pages 0 and 1 are used to map in the header of each
* table found via the RSDT or XSDT and pages 2 to n are used to map
* in the RSDT or XSDT. We have to use 2 pages for the table headers
* in case a header spans a page boundary. The offset is in pages;
* the length is in bytes.
*/
static void *
madt_map(vm_paddr_t pa, int offset, vm_offset_t length)
@ -232,7 +234,7 @@ madt_probe(void)
printf("MADT: RSDP failed extended checksum\n");
return (ENXIO);
}
xsdt = madt_map_table(rsdp->XsdtPhysicalAddress, 1, XSDT_SIG);
xsdt = madt_map_table(rsdp->XsdtPhysicalAddress, 2, XSDT_SIG);
if (xsdt == NULL) {
if (bootverbose)
printf("MADT: Failed to map XSDT\n");
@ -245,7 +247,7 @@ madt_probe(void)
break;
madt_unmap_table(xsdt);
} else {
rsdt = madt_map_table(rsdp->RsdtPhysicalAddress, 1, RSDT_SIG);
rsdt = madt_map_table(rsdp->RsdtPhysicalAddress, 2, RSDT_SIG);
if (rsdt == NULL) {
if (bootverbose)
printf("MADT: Failed to map RSDT\n");

View File

@ -106,9 +106,11 @@ static struct apic_enumerator madt_enumerator = {
/*
* Code to abuse the crashdump map to map in the tables for the early
* probe. We cheat and make the following assumptions about how we
* use this KVA: page 0 is used to map in the first page of each table
* found via the RSDT or XSDT and pages 1 to n are used to map in the
* RSDT or XSDT. The offset is in pages; the length is in bytes.
* use this KVA: pages 0 and 1 are used to map in the header of each
* table found via the RSDT or XSDT and pages 2 to n are used to map
* in the RSDT or XSDT. We have to use 2 pages for the table headers
* in case a header spans a page boundary. The offset is in pages;
* the length is in bytes.
*/
static void *
madt_map(vm_paddr_t pa, int offset, vm_offset_t length)
@ -232,7 +234,7 @@ madt_probe(void)
printf("MADT: RSDP failed extended checksum\n");
return (ENXIO);
}
xsdt = madt_map_table(rsdp->XsdtPhysicalAddress, 1, XSDT_SIG);
xsdt = madt_map_table(rsdp->XsdtPhysicalAddress, 2, XSDT_SIG);
if (xsdt == NULL) {
if (bootverbose)
printf("MADT: Failed to map XSDT\n");
@ -245,7 +247,7 @@ madt_probe(void)
break;
madt_unmap_table(xsdt);
} else {
rsdt = madt_map_table(rsdp->RsdtPhysicalAddress, 1, RSDT_SIG);
rsdt = madt_map_table(rsdp->RsdtPhysicalAddress, 2, RSDT_SIG);
if (rsdt == NULL) {
if (bootverbose)
printf("MADT: Failed to map RSDT\n");