Fix AcGetAcpiTable() routine failing to validate FADT checksum on some ACPI 2.0 and older machines
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 38s
Builds / ExectOS (i686) (push) Successful in 37s

This commit is contained in:
Rafal Kupiec 2024-06-03 21:58:19 +02:00
parent 9124574bc5
commit f265810a5c
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -148,18 +148,36 @@ AcGetAcpiTable(IN CONST UINT Signature,
}
/* Verify table signature and checksum */
if((TableHeader->Signature == Signature) && (AcpChecksumTable(TableHeader, TableHeader->Length) == 0))
if((TableHeader->Signature == Signature))
{
/* Found valid ACPI table */
*AcpiTable = TableHeader;
return STATUS_EFI_SUCCESS;
/* Found requested ACPI table */
break;
}
}
/* ACPI table not found */
/* Make sure table was 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;
}
/**
* Gets the Advanced Programmable Interrupt Controller (APIC) base address.
*