ShellPkg/AcpiView: RAS2 Parser - check validity of PCC Count
This checks the number of PCC descriptor entries provided match the count set in the table, and if they don't indicate a warning. Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
This commit is contained in:
parent
35216819b5
commit
b38180effe
|
@ -84,6 +84,8 @@ ParseAcpiRas2 (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT32 Offset;
|
UINT32 Offset;
|
||||||
|
UINT16 Count = 0;
|
||||||
|
CONST CHAR16 *Message;
|
||||||
|
|
||||||
if (!Trace) {
|
if (!Trace) {
|
||||||
return;
|
return;
|
||||||
|
@ -111,5 +113,18 @@ ParseAcpiRas2 (
|
||||||
sizeof (EFI_ACPI_RAS2_PCC_DESCRIPTOR)
|
sizeof (EFI_ACPI_RAS2_PCC_DESCRIPTOR)
|
||||||
);
|
);
|
||||||
Offset += sizeof (EFI_ACPI_RAS2_PCC_DESCRIPTOR);
|
Offset += sizeof (EFI_ACPI_RAS2_PCC_DESCRIPTOR);
|
||||||
|
Count++;
|
||||||
} // while
|
} // while
|
||||||
|
|
||||||
|
// Check counts match and print error if not
|
||||||
|
if (Count != *Ras2PccDescriptors) {
|
||||||
|
Message = Count > *Ras2PccDescriptors ? L"many" : L"few";
|
||||||
|
IncrementWarningCount ();
|
||||||
|
Print (
|
||||||
|
L"\nWARNING: Too %s descriptors provided (advertised %d, provided %d)",
|
||||||
|
Message,
|
||||||
|
*Ras2PccDescriptors,
|
||||||
|
Count
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue