summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorCarsten Haitzler <carsten.haitzler@foss.arm.com>2024-10-02 15:44:15 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-17 02:43:05 +0000
commitb38180effe5384c683f180aa5b899f3354c86818 (patch)
tree89100ad8eecd54ec049d32bbc14ee66ae231d173 /ShellPkg
parent35216819b5fb88778bc4049d42157ed7c3bd5010 (diff)
downloadedk2-b38180effe5384c683f180aa5b899f3354c86818.tar.gz
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>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ras2/Ras2Parser.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ras2/Ras2Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ras2/Ras2Parser.c
index 38bd15d95f..06ac5cdabc 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ras2/Ras2Parser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ras2/Ras2Parser.c
@@ -83,7 +83,9 @@ ParseAcpiRas2 (
IN UINT8 AcpiTableRevision
)
{
- UINT32 Offset;
+ UINT32 Offset;
+ UINT16 Count = 0;
+ CONST CHAR16 *Message;
if (!Trace) {
return;
@@ -111,5 +113,18 @@ ParseAcpiRas2 (
sizeof (EFI_ACPI_RAS2_PCC_DESCRIPTOR)
);
Offset += sizeof (EFI_ACPI_RAS2_PCC_DESCRIPTOR);
+ Count++;
} // 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
+ );
+ }
}