forked from xt-sys/exectos
Fix AcGetAcpiTable() routine failing to validate FADT checksum on some ACPI 2.0 and older machines
This commit is contained in:
parent
9124574bc5
commit
f265810a5c
@ -148,16 +148,34 @@ AcGetAcpiTable(IN CONST UINT Signature,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Verify table signature and checksum */
|
/* Verify table signature and checksum */
|
||||||
if((TableHeader->Signature == Signature) && (AcpChecksumTable(TableHeader, TableHeader->Length) == 0))
|
if((TableHeader->Signature == Signature))
|
||||||
{
|
{
|
||||||
/* Found valid ACPI table */
|
/* Found requested ACPI table */
|
||||||
*AcpiTable = TableHeader;
|
break;
|
||||||
return STATUS_EFI_SUCCESS;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ACPI table not found */
|
/* Make sure table was found */
|
||||||
return STATUS_EFI_NOT_FOUND;
|
if(TableHeader->Signature != Signature)
|
||||||
|
{
|
||||||
|
/* ACPI table not found, return error */
|
||||||
|
return STATUS_EFI_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Don't validate FADT on old, broken firmwares with ACPI 2.0 or older */
|
||||||
|
if(TableHeader->Signature != ACPI_FADT_SIGNATURE || TableHeader->Revision > 2)
|
||||||
|
{
|
||||||
|
/* Validate table checksum */
|
||||||
|
if(AcpChecksumTable(TableHeader, TableHeader->Length) != 0)
|
||||||
|
{
|
||||||
|
/* Checksum mismatch, return error */
|
||||||
|
return STATUS_EFI_CRC_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Found valid ACPI table, return success */
|
||||||
|
*AcpiTable = TableHeader;
|
||||||
|
return STATUS_EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user