/** @file\r
ACPI parser\r
\r
- Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.\r
+ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
**/\r
\r
UINT8 Checksum;\r
UINTN OriginalAttribute;\r
\r
+ //\r
+ // set local variables to suppress incorrect compiler/analyzer warnings\r
+ //\r
+ OriginalAttribute = 0;\r
ByteCount = 0;\r
Checksum = 0;\r
\r
\r
Val = *(UINT32*)(Ptr + sizeof (UINT32));\r
\r
- Val <<= 32;\r
+ Val = LShiftU64(Val,32);\r
Val |= (UINT64)*(UINT32*)Ptr;\r
\r
Print (Format, Val);\r
);\r
}\r
\r
+/**\r
+ This function traces 12 characters which can be optionally\r
+ formated using the format string if specified.\r
+\r
+ If no format string is specified the Format must be NULL.\r
+\r
+ @param [in] Format Optional format string for tracing the data.\r
+ @param [in] Ptr Pointer to the start of the buffer.\r
+**/\r
+VOID\r
+EFIAPI\r
+Dump12Chars (\r
+ IN CONST CHAR16* Format OPTIONAL,\r
+ IN UINT8* Ptr\r
+ )\r
+{\r
+ Print (\r
+ (Format != NULL) ? Format : L"%c%c%c%c%c%c%c%c%c%c%c%c",\r
+ Ptr[0],\r
+ Ptr[1],\r
+ Ptr[2],\r
+ Ptr[3],\r
+ Ptr[4],\r
+ Ptr[5],\r
+ Ptr[6],\r
+ Ptr[7],\r
+ Ptr[8],\r
+ Ptr[9],\r
+ Ptr[10],\r
+ Ptr[11]\r
+ );\r
+}\r
+\r
/**\r
This function indents and prints the ACPI table Field Name.\r
\r
BOOLEAN HighLight;\r
UINTN OriginalAttribute;\r
\r
+ //\r
+ // set local variables to suppress incorrect compiler/analyzer warnings\r
+ //\r
+ OriginalAttribute = 0;\r
Offset = 0;\r
\r
// Increment the Indent\r
\r
for (Index = 0; Index < ParserItems; Index++) {\r
if ((Offset + Parser[Index].Length) > Length) {\r
+\r
+ // For fields outside the buffer length provided, reset any pointers\r
+ // which were supposed to be updated by this function call\r
+ if (Parser[Index].ItemPtr != NULL) {\r
+ *Parser[Index].ItemPtr = NULL;\r
+ }\r
+\r
// We don't parse past the end of the max length specified\r
- break;\r
+ continue;\r
}\r
\r
if (GetConsistencyChecking () &&\r
IN UINT8* Ptr\r
)\r
{\r
- DumpGasStruct (Ptr, 2, GAS_LENGTH);\r
+ DumpGasStruct (Ptr, 2, sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE));\r
}\r
\r
/**\r
0,\r
"ACPI Table Header",\r
Ptr,\r
- ACPI_DESCRIPTION_HEADER_LENGTH,\r
+ sizeof (EFI_ACPI_DESCRIPTION_HEADER),\r
PARSER_PARAMS (AcpiHeaderParser)\r
);\r
}\r
0,\r
NULL,\r
Ptr,\r
- ACPI_DESCRIPTION_HEADER_LENGTH,\r
+ sizeof (EFI_ACPI_DESCRIPTION_HEADER),\r
PARSER_PARAMS (AcpiHeaderParser)\r
);\r
\r