]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c
ShellPkg/UefiShellAcpiViewCommandLib: Fix VS2017 compilation errors
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / Parsers / Gtdt / GtdtParser.c
index ce96604ee6f800adfbd861691ffa7093b9bd8239..0ab460b02c9e062ac181e42e7e77f875a40c86dc 100644 (file)
@@ -1,4 +1,4 @@
-/**\r
+/** @file\r
   GTDT table parser\r
 \r
   Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.\r
@@ -29,12 +29,13 @@ STATIC CONST UINT32* GtBlockTimerOffset;
 STATIC CONST UINT16* GtBlockLength;\r
 STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;\r
 \r
-/** This function validates the GT Block timer count.\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
+**/\r
 STATIC\r
 VOID\r
 EFIAPI\r
@@ -43,8 +44,9 @@ ValidateGtBlockTimerCount (
   IN VOID*  Context\r
   );\r
 \r
-/** An ACPI_PARSER array describing the ACPI GTDT Table.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the ACPI GTDT Table.\r
+**/\r
 STATIC CONST ACPI_PARSER GtdtParser[] = {\r
   PARSE_ACPI_HEADER (&AcpiHdrInfo),\r
   {L"CntControlBase Physical Address", 8, 36, L"0x%lx", NULL, NULL,\r
@@ -69,16 +71,18 @@ STATIC CONST ACPI_PARSER GtdtParser[] = {
    (VOID**)&GtdtPlatformTimerOffset, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the Platform timer header.\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
 };\r
 \r
-/** An ACPI_PARSER array describing the Platform GT Block.\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, (VOID**)&GtBlockLength, NULL, NULL},\r
@@ -90,8 +94,9 @@ STATIC CONST ACPI_PARSER GtBlockParser[] = {
     NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the GT Block timer.\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, NULL, NULL},\r
   {L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL},\r
@@ -105,8 +110,9 @@ STATIC CONST ACPI_PARSER GtBlockTimerParser[] = {
   {L"Common Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** An ACPI_PARSER array describing the Platform Watchdog.\r
-*/\r
+/**\r
+  An ACPI_PARSER array describing the Platform Watchdog.\r
+**/\r
 STATIC CONST ACPI_PARSER SBSAGenericWatchdogParser[] = {\r
   {L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL},\r
   {L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL},\r
@@ -117,12 +123,13 @@ STATIC CONST ACPI_PARSER SBSAGenericWatchdogParser[] = {
   {L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}\r
 };\r
 \r
-/** This function validates the GT Block timer count.\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
+**/\r
 STATIC\r
 VOID\r
 EFIAPI\r
@@ -131,7 +138,10 @@ ValidateGtBlockTimerCount (
   IN VOID*  Context\r
   )\r
 {\r
-  UINT32 BlockTimerCount = *(UINT32*)Ptr;\r
+  UINT32 BlockTimerCount;\r
+\r
+  BlockTimerCount = *(UINT32*)Ptr;\r
+\r
   if (BlockTimerCount > 8) {\r
     IncrementErrorCount ();\r
     Print (\r
@@ -141,21 +151,22 @@ ValidateGtBlockTimerCount (
   }\r
 }\r
 \r
-/** This function parses the Platform GT Block.\r
+/**\r
+  This function parses the Platform GT Block.\r
 \r
   @param [in] Ptr     Pointer to the start of the GT Block data.\r
   @param [in] Length  Length of the GT Block structure.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpGTBlock (\r
   IN UINT8* Ptr,\r
-  IN UINT16 Length\r
+  IN UINT32 Length\r
   )\r
 {\r
   UINT32 Index;\r
   UINT32 Offset;\r
-  UINT16 GTBlockTimerLength;\r
+  UINT32 GTBlockTimerLength;\r
 \r
   Offset = ParseAcpi (\r
              TRUE,\r
@@ -196,11 +207,12 @@ DumpGTBlock (
   }\r
 }\r
 \r
-/** This function parses the Platform Watchdog timer.\r
+/**\r
+  This function parses the Platform Watchdog timer.\r
 \r
   @param [in] Ptr     Pointer to the start of the watchdog timer data.\r
   @param [in] Length  Length of the watchdog timer structure.\r
-*/\r
+**/\r
 STATIC\r
 VOID\r
 DumpWatchdogTimer (\r
@@ -218,7 +230,8 @@ DumpWatchdogTimer (
     );\r
 }\r
 \r
-/** This function parses the ACPI GTDT table.\r
+/**\r
+  This function parses the ACPI GTDT table.\r
   When trace is enabled this function parses the GTDT table and\r
   traces the ACPI table fields.\r
 \r
@@ -232,7 +245,7 @@ DumpWatchdogTimer (
   @param [in] Ptr                Pointer to the start of the buffer.\r
   @param [in] AcpiTableLength    Length of the ACPI table.\r
   @param [in] AcpiTableRevision  Revision of the ACPI table.\r
-*/\r
+**/\r
 VOID\r
 EFIAPI\r
 ParseAcpiGtdt (\r