DynamicTablesPkg: Add frame number validation to GTDT generator

Added code to check if the Generic Timer Block Structure's frame number
provided by the platform repository is within the allowed range (0-7).

References:
- ACPI 6.2 Errata A, Table 5-122, September 2017

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
Krzysztof Koch 2019-04-10 11:28:55 +01:00 committed by Sami Mujawar
parent 98f98eb440
commit 75bf10a689
1 changed files with 9 additions and 0 deletions

View File

@ -218,6 +218,15 @@ AddGTBlockTimerFrames (
GtBlockFrame
));
if (GTBlockTimerFrameList->FrameNumber >= 8) {
DEBUG ((
DEBUG_ERROR,
"ERROR: GTDT: Frame number %d is not in the range 0-7\n",
GTBlockTimerFrameList->FrameNumber
));
return EFI_INVALID_PARAMETER;
}
GtBlockFrame->GTFrameNumber = GTBlockTimerFrameList->FrameNumber;
GtBlockFrame->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
GtBlockFrame->Reserved[1] = EFI_ACPI_RESERVED_BYTE;