#include "AcpiParser.h"\r
#include "AcpiTableParser.h"\r
\r
+// "The number of GT Block Timers must be less than or equal to 8"\r
+#define GT_BLOCK_TIMER_COUNT_MAX 8\r
+\r
// Local variables\r
STATIC CONST UINT32* GtdtPlatformTimerCount;\r
STATIC CONST UINT32* GtdtPlatformTimerOffset;\r
ValidateGtBlockTimerCount (\r
IN UINT8* Ptr,\r
IN VOID* Context\r
- );\r
+ )\r
+{\r
+ UINT32 BlockTimerCount;\r
+\r
+ BlockTimerCount = *(UINT32*)Ptr;\r
+\r
+ if (BlockTimerCount > GT_BLOCK_TIMER_COUNT_MAX) {\r
+ IncrementErrorCount ();\r
+ Print (\r
+ L"\nERROR: Timer Count = %d. Max Timer Count is %d.",\r
+ BlockTimerCount,\r
+ GT_BLOCK_TIMER_COUNT_MAX\r
+ );\r
+ }\r
+}\r
\r
/**\r
This function validates the GT Frame Number.\r
ValidateGtFrameNumber (\r
IN UINT8* Ptr,\r
IN VOID* Context\r
- );\r
+ )\r
+{\r
+ UINT8 FrameNumber;\r
+\r
+ FrameNumber = *(UINT8*)Ptr;\r
+\r
+ if (FrameNumber >= GT_BLOCK_TIMER_COUNT_MAX) {\r
+ IncrementErrorCount ();\r
+ Print (\r
+ L"\nERROR: GT Frame Number = %d. GT Frame Number must be in range 0-%d.",\r
+ FrameNumber,\r
+ GT_BLOCK_TIMER_COUNT_MAX - 1\r
+ );\r
+ }\r
+}\r
\r
/**\r
An ACPI_PARSER array describing the ACPI GTDT Table.\r
{L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}\r
};\r
\r
-/**\r
- This function validates the GT Block timer count.\r
-\r
- @param [in] Ptr Pointer to the start of the field data.\r
- @param [in] Context Pointer to context specific information e.g. this\r
- could be a pointer to the ACPI table header.\r
-**/\r
-STATIC\r
-VOID\r
-EFIAPI\r
-ValidateGtBlockTimerCount (\r
- IN UINT8* Ptr,\r
- IN VOID* Context\r
- )\r
-{\r
- UINT32 BlockTimerCount;\r
-\r
- BlockTimerCount = *(UINT32*)Ptr;\r
-\r
- if (BlockTimerCount > 8) {\r
- IncrementErrorCount ();\r
- Print (\r
- L"\nERROR: Timer Count = %d. Max Timer Count is 8.",\r
- BlockTimerCount\r
- );\r
- }\r
-}\r
-\r
-/**\r
- This function validates the GT Frame Number.\r
-\r
- @param [in] Ptr Pointer to the start of the field data.\r
- @param [in] Context Pointer to context specific information e.g. this\r
- could be a pointer to the ACPI table header.\r
-**/\r
-STATIC\r
-VOID\r
-EFIAPI\r
-ValidateGtFrameNumber (\r
- IN UINT8* Ptr,\r
- IN VOID* Context\r
- )\r
-{\r
- UINT8 FrameNumber;\r
-\r
- FrameNumber = *(UINT8*)Ptr;\r
-\r
- if (FrameNumber > 7) {\r
- IncrementErrorCount ();\r
- Print (\r
- L"\nERROR: GT Frame Number = %d. GT Frame Number must be in range 0-7.",\r
- FrameNumber\r
- );\r
- }\r
-}\r
-\r
/**\r
This function parses the Platform GT Block.\r
\r