#include "AcpiViewConfig.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
+#define GT_BLOCK_TIMER_COUNT_MAX 8\r
\r
// Local variables\r
-STATIC CONST UINT32* GtdtPlatformTimerCount;\r
-STATIC CONST UINT32* GtdtPlatformTimerOffset;\r
-STATIC CONST UINT8* PlatformTimerType;\r
-STATIC CONST UINT16* PlatformTimerLength;\r
-STATIC CONST UINT32* GtBlockTimerCount;\r
-STATIC CONST UINT32* GtBlockTimerOffset;\r
-STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;\r
+STATIC CONST UINT32 *GtdtPlatformTimerCount;\r
+STATIC CONST UINT32 *GtdtPlatformTimerOffset;\r
+STATIC CONST UINT8 *PlatformTimerType;\r
+STATIC CONST UINT16 *PlatformTimerLength;\r
+STATIC CONST UINT32 *GtBlockTimerCount;\r
+STATIC CONST UINT32 *GtBlockTimerOffset;\r
+STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;\r
\r
/**\r
This function validates the GT Block timer count.\r
VOID\r
EFIAPI\r
ValidateGtBlockTimerCount (\r
- IN UINT8* Ptr,\r
- IN VOID* Context\r
+ IN UINT8 *Ptr,\r
+ IN VOID *Context\r
)\r
{\r
- UINT32 BlockTimerCount;\r
+ UINT32 BlockTimerCount;\r
\r
- BlockTimerCount = *(UINT32*)Ptr;\r
+ BlockTimerCount = *(UINT32 *)Ptr;\r
\r
if (BlockTimerCount > GT_BLOCK_TIMER_COUNT_MAX) {\r
IncrementErrorCount ();\r
VOID\r
EFIAPI\r
ValidateGtFrameNumber (\r
- IN UINT8* Ptr,\r
- IN VOID* Context\r
+ IN UINT8 *Ptr,\r
+ IN VOID *Context\r
)\r
{\r
- UINT8 FrameNumber;\r
+ UINT8 FrameNumber;\r
\r
- FrameNumber = *(UINT8*)Ptr;\r
+ FrameNumber = *(UINT8 *)Ptr;\r
\r
if (FrameNumber >= GT_BLOCK_TIMER_COUNT_MAX) {\r
IncrementErrorCount ();\r
/**\r
An ACPI_PARSER array describing the ACPI GTDT Table.\r
**/\r
-STATIC CONST ACPI_PARSER GtdtParser[] = {\r
+STATIC CONST ACPI_PARSER GtdtParser[] = {\r
PARSE_ACPI_HEADER (&AcpiHdrInfo),\r
- {L"CntControlBase Physical Address", 8, 36, L"0x%lx", NULL, NULL,\r
- NULL, NULL},\r
- {L"Reserved", 4, 44, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Secure EL1 timer GSIV", 4, 48, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Secure EL1 timer FLAGS", 4, 52, L"0x%x", NULL, NULL, NULL, NULL},\r
-\r
- {L"Non-Secure EL1 timer GSIV", 4, 56, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Non-Secure EL1 timer FLAGS", 4, 60, L"0x%x", NULL, NULL, NULL, NULL},\r
-\r
- {L"Virtual timer GSIV", 4, 64, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Virtual timer FLAGS", 4, 68, L"0x%x", NULL, NULL, NULL, NULL},\r
-\r
- {L"Non-Secure EL2 timer GSIV", 4, 72, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Non-Secure EL2 timer FLAGS", 4, 76, L"0x%x", NULL, NULL, NULL, NULL},\r
-\r
- {L"CntReadBase Physical address", 8, 80, L"0x%lx", NULL, NULL, NULL, NULL},\r
- {L"Platform Timer Count", 4, 88, L"%d", NULL,\r
- (VOID**)&GtdtPlatformTimerCount, NULL, NULL},\r
- {L"Platform Timer Offset", 4, 92, L"0x%x", NULL,\r
- (VOID**)&GtdtPlatformTimerOffset, NULL, NULL},\r
- {L"Virtual EL2 Timer GSIV", 4, 96, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Virtual EL2 Timer Flags", 4, 100, L"0x%x", NULL, NULL, NULL, NULL}\r
+ { L"CntControlBase Physical Address",8, 36, L"0x%lx", NULL, NULL,\r
+ NULL, NULL },\r
+ { L"Reserved", 4, 44, L"0x%x", NULL, NULL,NULL, NULL },\r
+ { L"Secure EL1 timer GSIV", 4, 48, L"0x%x", NULL, NULL,NULL, NULL },\r
+ { L"Secure EL1 timer FLAGS", 4, 52, L"0x%x", NULL, NULL,NULL, NULL },\r
+\r
+ { L"Non-Secure EL1 timer GSIV", 4, 56, L"0x%x", NULL, NULL,NULL, NULL },\r
+ { L"Non-Secure EL1 timer FLAGS", 4, 60, L"0x%x", NULL, NULL,NULL, NULL },\r
+\r
+ { L"Virtual timer GSIV", 4, 64, L"0x%x", NULL, NULL,NULL, NULL },\r
+ { L"Virtual timer FLAGS", 4, 68, L"0x%x", NULL, NULL,NULL, NULL },\r
+\r
+ { L"Non-Secure EL2 timer GSIV", 4, 72, L"0x%x", NULL, NULL,NULL, NULL },\r
+ { L"Non-Secure EL2 timer FLAGS", 4, 76, L"0x%x", NULL, NULL,NULL, NULL },\r
+\r
+ { L"CntReadBase Physical address", 8, 80, L"0x%lx", NULL, NULL,NULL, NULL },\r
+ { L"Platform Timer Count", 4, 88, L"%d", NULL,\r
+ (VOID **)&GtdtPlatformTimerCount, NULL, NULL },\r
+ { L"Platform Timer Offset", 4, 92, L"0x%x", NULL,\r
+ (VOID **)&GtdtPlatformTimerOffset,NULL, NULL },\r
+ { L"Virtual EL2 Timer GSIV", 4, 96, L"0x%x", NULL, NULL,NULL, NULL },\r
+ { L"Virtual EL2 Timer Flags", 4, 100, L"0x%x", NULL, NULL,NULL, NULL }\r
};\r
\r
/**\r
An ACPI_PARSER array describing the Platform timer header.\r
**/\r
-STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser[] = {\r
- {L"Type", 1, 0, NULL, NULL, (VOID**)&PlatformTimerType, NULL, NULL},\r
- {L"Length", 2, 1, NULL, NULL, (VOID**)&PlatformTimerLength, NULL, NULL},\r
- {L"Reserved", 1, 3, NULL, NULL, NULL, NULL, NULL}\r
+STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser[] = {\r
+ { L"Type", 1, 0, NULL, NULL, (VOID **)&PlatformTimerType, NULL, NULL },\r
+ { L"Length", 2, 1, NULL, NULL, (VOID **)&PlatformTimerLength, NULL, NULL },\r
+ { L"Reserved", 1, 3, NULL, NULL, NULL, NULL, NULL }\r
};\r
\r
/**\r
An ACPI_PARSER array describing the Platform GT Block.\r
**/\r
-STATIC CONST ACPI_PARSER GtBlockParser[] = {\r
- {L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL},\r
- {L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL},\r
- {L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL},\r
- {L"Physical address (CntCtlBase)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL},\r
- {L"Timer Count", 4, 12, L"%d", NULL, (VOID**)&GtBlockTimerCount,\r
- ValidateGtBlockTimerCount, NULL},\r
- {L"Timer Offset", 4, 16, L"%d", NULL, (VOID**)&GtBlockTimerOffset, NULL,\r
- NULL}\r
+STATIC CONST ACPI_PARSER GtBlockParser[] = {\r
+ { L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL },\r
+ { L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL },\r
+ { L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL },\r
+ { L"Physical address (CntCtlBase)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },\r
+ { L"Timer Count", 4, 12, L"%d", NULL, (VOID **)&GtBlockTimerCount,\r
+ ValidateGtBlockTimerCount, NULL },\r
+ { L"Timer Offset", 4, 16, L"%d", NULL, (VOID **)&GtBlockTimerOffset, NULL,\r
+ NULL }\r
};\r
\r
/**\r
An ACPI_PARSER array describing the GT Block timer.\r
**/\r
-STATIC CONST ACPI_PARSER GtBlockTimerParser[] = {\r
- {L"Frame Number", 1, 0, L"%d", NULL, NULL, ValidateGtFrameNumber, NULL},\r
- {L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL},\r
- {L"Physical address (CntBaseX)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL},\r
- {L"Physical address (CntEL0BaseX)", 8, 12, L"0x%lx", NULL, NULL, NULL,\r
- NULL},\r
- {L"Physical Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Physical Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Virtual Timer GSIV", 4, 28, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Virtual Timer Flags", 4, 32, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Common Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL}\r
+STATIC CONST ACPI_PARSER GtBlockTimerParser[] = {\r
+ { L"Frame Number", 1, 0, L"%d", NULL, NULL, ValidateGtFrameNumber, NULL },\r
+ { L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },\r
+ { L"Physical address (CntBaseX)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },\r
+ { L"Physical address (CntEL0BaseX)", 8, 12, L"0x%lx", NULL, NULL, NULL,\r
+ NULL },\r
+ { L"Physical Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },\r
+ { L"Physical Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL },\r
+ { L"Virtual Timer GSIV", 4, 28, L"0x%x", NULL, NULL, NULL, NULL },\r
+ { L"Virtual Timer Flags", 4, 32, L"0x%x", NULL, NULL, NULL, NULL },\r
+ { L"Common Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL }\r
};\r
\r
/**\r
An ACPI_PARSER array describing the Platform Watchdog.\r
**/\r
-STATIC CONST ACPI_PARSER ArmGenericWatchdogParser[] = {\r
- {L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL},\r
- {L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL},\r
- {L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL},\r
- {L"RefreshFrame Physical address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL},\r
- {L"ControlFrame Physical address", 8, 12, L"0x%lx", NULL, NULL, NULL, NULL},\r
- {L"Watchdog Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL},\r
- {L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}\r
+STATIC CONST ACPI_PARSER ArmGenericWatchdogParser[] = {\r
+ { L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL },\r
+ { L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL },\r
+ { L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL },\r
+ { L"RefreshFrame Physical address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL },\r
+ { L"ControlFrame Physical address", 8, 12, L"0x%lx", NULL, NULL, NULL, NULL },\r
+ { L"Watchdog Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },\r
+ { L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL }\r
};\r
\r
/**\r
STATIC\r
VOID\r
DumpGTBlock (\r
- IN UINT8* Ptr,\r
- IN UINT16 Length\r
+ IN UINT8 *Ptr,\r
+ IN UINT16 Length\r
)\r
{\r
- UINT32 Index;\r
- UINT32 Offset;\r
+ UINT32 Index;\r
+ UINT32 Offset;\r
\r
ParseAcpi (\r
TRUE,\r
// Check if the values used to control the parsing logic have been\r
// successfully read.\r
if ((GtBlockTimerCount == NULL) ||\r
- (GtBlockTimerOffset == NULL)) {\r
+ (GtBlockTimerOffset == NULL))\r
+ {\r
IncrementErrorCount ();\r
Print (\r
L"ERROR: Insufficient GT Block Structure length. Length = %d.\n",\r
}\r
\r
Offset = *GtBlockTimerOffset;\r
- Index = 0;\r
+ Index = 0;\r
\r
// Parse the specified number of GT Block Timer Structures or the GT Block\r
// Structure buffer length. Whichever is minimum.\r
while ((Index++ < *GtBlockTimerCount) &&\r
- (Offset < Length)) {\r
+ (Offset < Length))\r
+ {\r
Offset += ParseAcpi (\r
TRUE,\r
2,\r
STATIC\r
VOID\r
DumpWatchdogTimer (\r
- IN UINT8* Ptr,\r
- IN UINT16 Length\r
+ IN UINT8 *Ptr,\r
+ IN UINT16 Length\r
)\r
{\r
ParseAcpi (\r
VOID\r
EFIAPI\r
ParseAcpiGtdt (\r
- IN BOOLEAN Trace,\r
- IN UINT8* Ptr,\r
- IN UINT32 AcpiTableLength,\r
- IN UINT8 AcpiTableRevision\r
+ IN BOOLEAN Trace,\r
+ IN UINT8 *Ptr,\r
+ IN UINT32 AcpiTableLength,\r
+ IN UINT8 AcpiTableRevision\r
)\r
{\r
- UINT32 Index;\r
- UINT32 Offset;\r
- UINT8* TimerPtr;\r
+ UINT32 Index;\r
+ UINT32 Offset;\r
+ UINT8 *TimerPtr;\r
\r
if (!Trace) {\r
return;\r
// Check if the values used to control the parsing logic have been\r
// successfully read.\r
if ((GtdtPlatformTimerCount == NULL) ||\r
- (GtdtPlatformTimerOffset == NULL)) {\r
+ (GtdtPlatformTimerOffset == NULL))\r
+ {\r
IncrementErrorCount ();\r
Print (\r
L"ERROR: Insufficient table length. AcpiTableLength = %d.\n",\r
}\r
\r
TimerPtr = Ptr + *GtdtPlatformTimerOffset;\r
- Offset = *GtdtPlatformTimerOffset;\r
- Index = 0;\r
+ Offset = *GtdtPlatformTimerOffset;\r
+ Index = 0;\r
\r
// Parse the specified number of Platform Timer Structures or the GTDT\r
// buffer length. Whichever is minimum.\r
while ((Index++ < *GtdtPlatformTimerCount) &&\r
- (Offset < AcpiTableLength)) {\r
+ (Offset < AcpiTableLength))\r
+ {\r
// Parse the Platform Timer Header to obtain Length and Type\r
ParseAcpi (\r
FALSE,\r
// Check if the values used to control the parsing logic have been\r
// successfully read.\r
if ((PlatformTimerType == NULL) ||\r
- (PlatformTimerLength == NULL)) {\r
+ (PlatformTimerLength == NULL))\r
+ {\r
IncrementErrorCount ();\r
Print (\r
L"ERROR: Insufficient remaining table buffer length to read the " \\r
- L"Platform Timer Structure header. Length = %d.\n",\r
+ L"Platform Timer Structure header. Length = %d.\n",\r
AcpiTableLength - Offset\r
);\r
return;\r
\r
// Validate Platform Timer Structure length\r
if ((*PlatformTimerLength == 0) ||\r
- ((Offset + (*PlatformTimerLength)) > AcpiTableLength)) {\r
+ ((Offset + (*PlatformTimerLength)) > AcpiTableLength))\r
+ {\r
IncrementErrorCount ();\r
Print (\r
L"ERROR: Invalid Platform Timer Structure length. " \\r
- L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",\r
+ L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",\r
*PlatformTimerLength,\r
Offset,\r
AcpiTableLength\r
} // switch\r
\r
TimerPtr += *PlatformTimerLength;\r
- Offset += *PlatformTimerLength;\r
+ Offset += *PlatformTimerLength;\r
} // while\r
}\r