From nobody Fri Apr 19 14:41:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1528187718195550.8450209436924; Tue, 5 Jun 2018 01:35:18 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DE06621144CE9; Tue, 5 Jun 2018 01:35:16 -0700 (PDT) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2D21421140F43 for ; Tue, 5 Jun 2018 01:35:16 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2018 01:35:15 -0700 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2018 01:35:13 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,478,1520924400"; d="scan'208";a="54844279" From: Dandan Bi To: edk2-devel@lists.01.org Date: Tue, 5 Jun 2018 16:33:47 +0800 Message-Id: <20180605083348.81864-2-dandan.bi@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 In-Reply-To: <20180605083348.81864-1-dandan.bi@intel.com> References: <20180605083348.81864-1-dandan.bi@intel.com> Subject: [edk2] [patch 1/2] ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issues X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey , Ruiyu Ni MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Make the function comments follow EDK2 coding style. Cc: Sami Mujawar Cc: Evan Lloyd Cc: Sami Mujawar Cc: Evan Lloyd Cc: Jaben Carsey Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- .../UefiShellAcpiViewCommandLib/AcpiParser.c | 130 ++++++------ .../UefiShellAcpiViewCommandLib/AcpiParser.h | 223 ++++++++++++-----= ---- .../UefiShellAcpiViewCommandLib/AcpiTableParser.c | 27 ++- .../UefiShellAcpiViewCommandLib/AcpiTableParser.h | 39 ++-- .../Library/UefiShellAcpiViewCommandLib/AcpiView.c | 55 +++-- .../Library/UefiShellAcpiViewCommandLib/AcpiView.h | 59 +++--- .../Parsers/Bgrt/BgrtParser.c | 12 +- .../Parsers/Dbg2/Dbg2Parser.c | 29 +-- .../Parsers/Dsdt/DsdtParser.c | 7 +- .../Parsers/Fadt/FadtParser.c | 68 +++++-- .../Parsers/Gtdt/GtdtParser.c | 52 +++-- .../Parsers/Iort/IortParser.c | 133 +++++++----- .../Parsers/Madt/MadtParser.c | 63 +++--- .../Parsers/Mcfg/McfgParser.c | 18 +- .../Parsers/Rsdp/RsdpParser.c | 32 +-- .../Parsers/Slit/SlitParser.c | 17 +- .../Parsers/Spcr/SpcrParser.c | 32 +-- .../Parsers/Srat/SratParser.c | 61 +++--- .../Parsers/Ssdt/SsdtParser.c | 7 +- .../Parsers/Xsdt/XsdtParser.c | 11 +- .../UefiShellAcpiViewCommandLib.c | 13 +- .../UefiShellAcpiViewCommandLib.h | 4 +- 22 files changed, 645 insertions(+), 447 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/Sh= ellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c index 318f386fda1..088575d0144 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c @@ -1,6 +1,6 @@ -/** +/** @file ACPI parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -19,88 +19,95 @@ =20 STATIC UINT32 gIndent; STATIC UINT32 mTableErrorCount; STATIC UINT32 mTableWarningCount; =20 -/** This function resets the ACPI table error counter to Zero. -*/ +/** + This function resets the ACPI table error counter to Zero. +**/ VOID ResetErrorCount ( VOID ) { mTableErrorCount =3D 0; } =20 -/** This function returns the ACPI table error count. +/** + This function returns the ACPI table error count. =20 @retval Returns the count of errors detected in the ACPI tables. -*/ +**/ UINT32 GetErrorCount ( VOID ) { return mTableErrorCount; } =20 -/** This function resets the ACPI table warning counter to Zero. -*/ +/** + This function resets the ACPI table warning counter to Zero. +**/ VOID ResetWarningCount ( VOID ) { mTableWarningCount =3D 0; } =20 -/** This function returns the ACPI table warning count. +/** + This function returns the ACPI table warning count. =20 @retval Returns the count of warning detected in the ACPI tables. -*/ +**/ UINT32 GetWarningCount ( VOID ) { return mTableWarningCount; } =20 -/** This function increments the ACPI table error counter. -*/ +/** + This function increments the ACPI table error counter. +**/ VOID EFIAPI IncrementErrorCount ( VOID ) { mTableErrorCount++; } =20 -/** This function increments the ACPI table warning counter. -*/ +/** + This function increments the ACPI table warning counter. +**/ VOID EFIAPI IncrementWarningCount ( VOID ) { mTableWarningCount++; } =20 -/** This function verifies the ACPI table checksum. +/** + This function verifies the ACPI table checksum. =20 This function verifies the checksum for the ACPI table and optionally prints the status. =20 @param [in] Log If TRUE log the status of the checksum. @param [in] Ptr Pointer to the start of the table buffer. @param [in] Length The length of the buffer. =20 @retval TRUE The checksum is OK. @retval FALSE The checksum failed. -*/ +**/ BOOLEAN EFIAPI VerifyChecksum ( IN BOOLEAN Log, IN UINT8* Ptr, @@ -144,15 +151,16 @@ VerifyChecksum ( } =20 return (Checksum =3D=3D 0); } =20 -/** This function performs a raw data dump of the ACPI table. +/** + This function performs a raw data dump of the ACPI table. =20 @param [in] Ptr Pointer to the start of the table buffer. @param [in] Length The length of the buffer. -*/ +**/ VOID EFIAPI DumpRaw ( IN UINT8* Ptr, IN UINT32 Length @@ -203,64 +211,64 @@ DumpRaw ( // Print ASCII data for the final line. AsciiBuffer[AsciiBufferIndex] =3D '\0'; Print (L" %a", AsciiBuffer); } =20 -/** This function traces 1 byte of data as specified in the - format string. +/** + This function traces 1 byte of data as specified in the format string. =20 @param [in] Format The format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpUint8 ( IN CONST CHAR16* Format, IN UINT8* Ptr ) { Print (Format, *Ptr); } =20 -/** This function traces 2 bytes of data as specified in the - format string. +/** + This function traces 2 bytes of data as specified in the format string. =20 @param [in] Format The format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpUint16 ( IN CONST CHAR16* Format, IN UINT8* Ptr ) { Print (Format, *(UINT16*)Ptr); } =20 -/** This function traces 4 bytes of data as specified in the - format string. +/** + This function traces 4 bytes of data as specified in the format string. =20 @param [in] Format The format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpUint32 ( IN CONST CHAR16* Format, IN UINT8* Ptr ) { Print (Format, *(UINT32*)Ptr); } =20 -/** This function traces 8 bytes of data as specified by the - format string. +/** + This function traces 8 bytes of data as specified by the format string. =20 @param [in] Format The format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpUint64 ( IN CONST CHAR16* Format, IN UINT8* Ptr @@ -274,18 +282,19 @@ DumpUint64 ( Val |=3D *(UINT32*)Ptr; =20 Print (Format, Val); } =20 -/** This function traces 3 characters which can be optionally - formated using the format string if specified. +/** + This function traces 3 characters which can be optionally + formated using the format string if specified. =20 If no format string is specified the Format must be NULL. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI Dump3Chars ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr @@ -297,18 +306,19 @@ Dump3Chars ( Ptr[1], Ptr[2] ); } =20 -/** This function traces 4 characters which can be optionally - formated using the format string if specified. +/** + This function traces 4 characters which can be optionally + formated using the format string if specified. =20 If no format string is specified the Format must be NULL. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI Dump4Chars ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr @@ -321,18 +331,19 @@ Dump4Chars ( Ptr[2], Ptr[3] ); } =20 -/** This function traces 6 characters which can be optionally - formated using the format string if specified. +/** + This function traces 6 characters which can be optionally + formated using the format string if specified. =20 If no format string is specified the Format must be NULL. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI Dump6Chars ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr @@ -347,18 +358,19 @@ Dump6Chars ( Ptr[4], Ptr[5] ); } =20 -/** This function traces 8 characters which can be optionally - formated using the format string if specified. +/** + This function traces 8 characters which can be optionally + formated using the format string if specified. =20 If no format string is specified the Format must be NULL. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI Dump8Chars ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr @@ -375,21 +387,22 @@ Dump8Chars ( Ptr[6], Ptr[7] ); } =20 -/** This function indents and prints the ACPI table Field Name. +/** + This function indents and prints the ACPI table Field Name. =20 @param [in] Indent Number of spaces to add to the global table inde= nt. The global table indent is 0 by default; however this value is updated on entry to the ParseAcpi() by adding the indent value provided to ParseAcpi= () and restored back on exit. Therefore the total indent in the output is dependent on from where this function is called. @param [in] FieldName Pointer to the Field Name. -*/ +**/ VOID EFIAPI PrintFieldName ( IN UINT32 Indent, IN CONST CHAR16* FieldName @@ -402,11 +415,12 @@ PrintFieldName ( (OUTPUT_FIELD_COLUMN_WIDTH - gIndent - Indent), FieldName ); } =20 -/** This function is used to parse an ACPI table buffer. +/** + This function is used to parse an ACPI table buffer. =20 The ACPI table buffer is parsed using the ACPI table parser information specified by a pointer to an array of ACPI_PARSER elements. This parser function iterates through each item on the ACPI_PARSER array and logs the ACPI table fields. @@ -426,11 +440,11 @@ PrintFieldName ( @param [in] Parser Pointer to an array of ACPI_PARSER structure th= at describes the table being parsed. @param [in] ParserItems Number of items in the ACPI_PARSER array. =20 @retval Number of bytes parsed. -*/ +**/ UINT32 EFIAPI ParseAcpi ( IN BOOLEAN Trace, IN UINT32 Indent, @@ -538,28 +552,29 @@ ParseAcpi ( // Decrement the Indent gIndent -=3D Indent; return Offset; } =20 -/** An array describing the ACPI Generic Address Structure. +/** + An array describing the ACPI Generic Address Structure. The GasParser array is used by the ParseAcpi function to parse and/or tr= ace the GAS structure. -*/ +**/ STATIC CONST ACPI_PARSER GasParser[] =3D { {L"Address Space ID", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Register Bit Width", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, {L"Register Bit Offset", 1, 2, L"0x%x", NULL, NULL, NULL, NULL}, {L"Address Size", 1, 3, L"0x%x", NULL, NULL, NULL, NULL}, {L"Address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL} }; =20 -/** This function indents and traces the GAS structure as described - by the GasParser. +/** + This function indents and traces the GAS structure as described by the G= asParser. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Indent Number of spaces to indent the output. -*/ +**/ VOID EFIAPI DumpGasStruct ( IN UINT8* Ptr, IN UINT32 Indent @@ -574,31 +589,33 @@ DumpGasStruct ( GAS_LENGTH, PARSER_PARAMS (GasParser) ); } =20 -/** This function traces the GAS structure as described by the GasParser. +/** + This function traces the GAS structure as described by the GasParser. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpGas ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr ) { DumpGasStruct (Ptr, 2); } =20 -/** This function traces the ACPI header as described by the AcpiHeaderPar= ser. +/** + This function traces the ACPI header as described by the AcpiHeaderParse= r. =20 @param [in] Ptr Pointer to the start of the buffer. =20 @retval Number of bytes parsed. -*/ +**/ UINT32 EFIAPI DumpAcpiHeader ( IN UINT8* Ptr ) @@ -616,22 +633,23 @@ DumpAcpiHeader ( ACPI_DESCRIPTION_HEADER_LENGTH, PARSER_PARAMS (AcpiHeaderParser) ); } =20 -/** This function parses the ACPI header as described by the AcpiHeaderPar= ser. +/** + This function parses the ACPI header as described by the AcpiHeaderParse= r. =20 This function optionally returns the signature, length and revision of t= he ACPI table. =20 @param [in] Ptr Pointer to the start of the buffer. @param [out] Signature Gets location of the ACPI table signature. @param [out] Length Gets location of the length of the ACPI table. @param [out] Revision Gets location of the revision of the ACPI table. =20 @retval Number of bytes parsed. -*/ +**/ UINT32 EFIAPI ParseAcpiHeader ( IN UINT8* Ptr, OUT CONST UINT32** Signature, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/Sh= ellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h index 4dadd4d1042..ecf7dae9038 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h @@ -1,6 +1,6 @@ -/** +/** @file Header file for ACPI parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -20,207 +20,219 @@ /// However The signature for ACPI tables is 4 bytes. /// To work around this oddity define a signature type /// that allows us to process the log options. #define RSDP_TABLE_INFO SIGNATURE_32('R', 'S', 'D', 'P') =20 -/** This function increments the ACPI table error counter. -*/ +/** + This function increments the ACPI table error counter. +**/ VOID EFIAPI IncrementErrorCount ( VOID ); =20 -/** This function increments the ACPI table warning counter. -*/ +/** + This function increments the ACPI table warning counter. +**/ VOID EFIAPI IncrementWarningCount ( VOID ); =20 -/** This function verifies the ACPI table checksum. +/** + This function verifies the ACPI table checksum. =20 This function verifies the checksum for the ACPI table and optionally prints the status. =20 @param [in] Log If TRUE log the status of the checksum. @param [in] Ptr Pointer to the start of the table buffer. @param [in] Length The length of the buffer. =20 @retval TRUE The checksum is OK. @retval FALSE The checksum failed. -*/ +**/ BOOLEAN EFIAPI VerifyChecksum ( IN BOOLEAN Log, IN UINT8* Ptr, IN UINT32 Length ); =20 -/** This function performs a raw data dump of the ACPI table. +/** + This function performs a raw data dump of the ACPI table. =20 @param [in] Ptr Pointer to the start of the table buffer. @param [in] Length The length of the buffer. -*/ +**/ VOID EFIAPI DumpRaw ( IN UINT8* Ptr, IN UINT32 Length ); =20 -/** This function traces 1 byte of datum as specified in the - format string. +/** + This function traces 1 byte of datum as specified in the format string. =20 @param [in] Format The format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpUint8 ( IN CONST CHAR16* Format, IN UINT8* Ptr ); =20 -/** This function traces 2 bytes of data as specified in the - format string. +/** + This function traces 2 bytes of data as specified in the format string. =20 @param [in] Format The format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpUint16 ( IN CONST CHAR16* Format, IN UINT8* Ptr ); =20 -/** This function traces 4 bytes of data as specified in the - format string. +/** + This function traces 4 bytes of data as specified in the format string. =20 @param [in] Format The format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpUint32 ( IN CONST CHAR16* Format, IN UINT8* Ptr ); =20 -/** This function traces 8 bytes of data as specified by the - format string. +/** + This function traces 8 bytes of data as specified by the format string. =20 @param [in] Format The format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpUint64 ( IN CONST CHAR16* Format, IN UINT8* Ptr ); =20 -/** This function traces 3 characters which can be optionally - formated using the format string if specified. +/** + This function traces 3 characters which can be optionally + formated using the format string if specified. =20 If no format string is specified the Format must be NULL. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI Dump3Chars ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr ); =20 -/** This function traces 4 characters which can be optionally - formated using the format string if specified. +/** + This function traces 4 characters which can be optionally + formated using the format string if specified. =20 If no format string is specified the Format must be NULL. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI Dump4Chars ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr ); =20 -/** This function traces 6 characters which can be optionally - formated using the format string if specified. +/** + This function traces 6 characters which can be optionally + formated using the format string if specified. =20 If no format string is specified the Format must be NULL. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI Dump6Chars ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr ); =20 -/** This function traces 8 characters which can be optionally - formated using the format string if specified. +/** + This function traces 8 characters which can be optionally + formated using the format string if specified. =20 If no format string is specified the Format must be NULL. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI Dump8Chars ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr ); =20 -/** This function indents and prints the ACPI table Field Name. +/** + This function indents and prints the ACPI table Field Name. =20 @param [in] Indent Number of spaces to add to the global table indent. The global table indent is 0 by default; however this value is updated on entry to the ParseAcpi() by adding the indent value provided = to ParseAcpi() and restored back on exit. Therefore the total indent in the output is dependent on f= rom where this function is called. @param [in] FieldName Pointer to the Field Name. -*/ +**/ VOID EFIAPI PrintFieldName ( IN UINT32 Indent, IN CONST CHAR16* FieldName -); + ); =20 -/** This function pointer is the template for customizing the trace output +/** + This function pointer is the template for customizing the trace output =20 @param [in] Format Format string for tracing the data as specified by the 'Format' member of ACPI_PARSER. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR16* Format, UINT8* = Ptr); =20 -/** This function pointer is the template for validating an ACPI table fie= ld. +/** + This function pointer is the template for validating an ACPI table field. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information as specified= by the 'Context' member of the ACPI_PARSER. e.g. this could be a pointer to the ACPI table heade= r. -*/ +**/ typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8* Ptr, VOID* Context); =20 -/** The ACPI_PARSER structure describes the fields of an ACPI table and - provides means for the parser to interpret and trace appropriately. +/** + The ACPI_PARSER structure describes the fields of an ACPI table and + provides means for the parser to interpret and trace appropriately. =20 The first three members are populated based on information present in in the ACPI table specifications. The remaining members describe how the parser should report the field information, validate the field data and/or update an external pointer to the field (ItemPtr). @@ -232,11 +244,11 @@ typedef VOID (EFIAPI *FNPTR_FIELD_VALIDATOR)(UINT8* P= tr, VOID* Context); The PrintFormatter function may choose to use the format string specified by 'Format' or use its own internal format string. =20 The 'Format' and 'PrintFormatter' members allow flexibility for representing the field data. -*/ +**/ typedef struct AcpiParser { =20 /// String describing the ACPI table field /// (Field column from ACPI table spec) CONST CHAR16* NameStr; @@ -276,13 +288,14 @@ typedef struct AcpiParser { /// decisions about the field being validated. /// e.g. this could be a pointer to the ACPI table header VOID* Context; } ACPI_PARSER; =20 -/** A structure used to store the pointers to the members of the - ACPI description header structure that was parsed. -*/ +/** + A structure used to store the pointers to the members of the + ACPI description header structure that was parsed. +**/ typedef struct AcpiDescriptionHeaderInfo { /// ACPI table signature UINT32* Signature; /// Length of the ACPI table UINT32* Length; @@ -300,11 +313,12 @@ typedef struct AcpiDescriptionHeaderInfo { UINT32* CreatorId; /// Creator revision UINT32* CreatorRevision; } ACPI_DESCRIPTION_HEADER_INFO; =20 -/** This function is used to parse an ACPI table buffer. +/** + This function is used to parse an ACPI table buffer. =20 The ACPI table buffer is parsed using the ACPI table parser information specified by a pointer to an array of ACPI_PARSER elements. This parser function iterates through each item on the ACPI_PARSER array and logs the ACPI table fields. @@ -324,34 +338,36 @@ typedef struct AcpiDescriptionHeaderInfo { @param [in] Parser Pointer to an array of ACPI_PARSER structure th= at describes the table being parsed. @param [in] ParserItems Number of items in the ACPI_PARSER array. =20 @retval Number of bytes parsed. -*/ +**/ UINT32 EFIAPI ParseAcpi ( IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8* AsciiName OPTIONAL, IN UINT8* Ptr, IN UINT32 Length, IN CONST ACPI_PARSER* Parser, IN UINT32 ParserItems -); + ); =20 -/** This is a helper macro to pass parameters to the Parser functions. +/** + This is a helper macro to pass parameters to the Parser functions. =20 @param [in] Parser The name of the ACPI_PARSER array describing the ACPI table fields. -*/ +**/ #define PARSER_PARAMS(Parser) Parser, sizeof (Parser) / sizeof (Parser[0]) =20 -/** This is a helper macro for describing the ACPI header fields. +/** + This is a helper macro for describing the ACPI header fields. =20 @param [out] Info Pointer to retrieve the ACPI table header information. -*/ +**/ #define PARSE_ACPI_HEADER(Info) \ { L"Signature", 4, 0, NULL, Dump4Chars, \ (VOID**)&(Info)->Signature , NULL, NULL }, \ { L"Length", 4, 4, L"%d", NULL, \ (VOID**)&(Info)->Length, NULL, NULL }, \ @@ -368,167 +384,177 @@ ParseAcpi ( { L"Creator ID", 4, 28, NULL, Dump4Chars, \ (VOID**)&(Info)->CreatorId, NULL, NULL }, \ { L"Creator Revision", 4, 32, L"0x%X", NULL, \ (VOID**)&(Info)->CreatorRevision, NULL, NULL } =20 -/** Length of the ACPI GAS structure. +/** + Length of the ACPI GAS structure. =20 NOTE: This might normally be defined as sizeof (EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE). However, we deliberately minimise any reference to the EDK2 ACPI headers in an attempt to provide cross checking. -*/ +**/ #define GAS_LENGTH 12 =20 -/** Length of the ACPI Header structure. +/** + Length of the ACPI Header structure. =20 NOTE: This might normally be defined as sizeof (EFI_ACPI_DESCRIPTION_HEADER). However, we deliberately minimise any reference to the EDK2 ACPI headers in an attempt to provide cross checking. -*/ +**/ #define ACPI_DESCRIPTION_HEADER_LENGTH 36 =20 -/** This function indents and traces the GAS structure as described - by the GasParser. +/** + This function indents and traces the GAS structure as described by the G= asParser. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Indent Number of spaces to indent the output. -*/ +**/ VOID EFIAPI DumpGasStruct ( IN UINT8* Ptr, IN UINT32 Indent ); =20 -/** This function traces the GAS structure as described by the GasParser. +/** + This function traces the GAS structure as described by the GasParser. =20 @param [in] Format Optional format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ VOID EFIAPI DumpGas ( IN CONST CHAR16* Format OPTIONAL, IN UINT8* Ptr ); =20 -/** This function traces the ACPI header as described by the AcpiHeaderPar= ser. +/** + This function traces the ACPI header as described by the AcpiHeaderParse= r. =20 @param [in] Ptr Pointer to the start of the buffer. =20 @retval Number of bytes parsed. -*/ +**/ UINT32 EFIAPI DumpAcpiHeader ( IN UINT8* Ptr ); =20 -/** This function parses the ACPI header as described by the AcpiHeaderPar= ser. +/** + This function parses the ACPI header as described by the AcpiHeaderParse= r. =20 This function optionally returns the Signature, Length and revision of t= he ACPI table. =20 @param [in] Ptr Pointer to the start of the buffer. @param [out] Signature Gets location of the ACPI table signature. @param [out] Length Gets location of the length of the ACPI table. @param [out] Revision Gets location of the revision of the ACPI table. =20 @retval Number of bytes parsed. -*/ +**/ UINT32 EFIAPI ParseAcpiHeader ( IN UINT8* Ptr, OUT CONST UINT32** Signature, OUT CONST UINT32** Length, OUT CONST UINT8** Revision ); =20 -/** This function parses the ACPI BGRT table. +/** + This function parses the ACPI BGRT table. When trace is enabled this function parses the BGRT table and traces the ACPI table fields. =20 This function also performs validation of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiBgrt ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI DBG2 table. +/** + This function parses the ACPI DBG2 table. When trace is enabled this function parses the DBG2 table and traces the ACPI table fields. =20 This function also performs validation of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiDbg2 ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI DSDT table. +/** + This function parses the ACPI DSDT table. When trace is enabled this function parses the DSDT table and traces the ACPI table fields. For the DSDT table only the ACPI header fields are parsed and traced. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiDsdt ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI FADT table. +/** + This function parses the ACPI FADT table. This function parses the FADT table and optionally traces the ACPI table fields. =20 This function also performs validation of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiFadt ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI GTDT table. +/** + This function parses the ACPI GTDT table. When trace is enabled this function parses the GTDT table and traces the ACPI table fields. =20 This function also parses the following platform timer structures: - GT Block timer @@ -538,21 +564,22 @@ ParseAcpiFadt ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiGtdt ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI IORT table. +/** + This function parses the ACPI IORT table. When trace is enabled this function parses the IORT table and traces the ACPI fields. =20 This function also parses the following nodes: - ITS Group @@ -566,21 +593,22 @@ ParseAcpiGtdt ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiIort ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI MADT table. +/** + This function parses the ACPI MADT table. When trace is enabled this function parses the MADT table and traces the ACPI table fields. =20 This function currently parses the following Interrupt Controller Structures: @@ -594,41 +622,43 @@ ParseAcpiIort ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiMadt ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI MCFG table. +/** + This function parses the ACPI MCFG table. When trace is enabled this function parses the MCFG table and traces the ACPI table fields. =20 This function also performs validation of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiMcfg ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI RSDP table. +/** + This function parses the ACPI RSDP table. =20 This function invokes the parser for the XSDT table. * Note - This function does not support parsing of RSDT table. =20 This function also performs a RAW dump of the ACPI table and @@ -636,21 +666,22 @@ ParseAcpiMcfg ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiRsdp ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI SLIT table. +/** + This function parses the ACPI SLIT table. When trace is enabled this function parses the SLIT table and traces the ACPI table fields. =20 This function also validates System Localities for the following: - Diagonal elements have a normalized value of 10 @@ -659,41 +690,43 @@ ParseAcpiRsdp ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiSlit ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI SPCR table. +/** + This function parses the ACPI SPCR table. When trace is enabled this function parses the SPCR table and traces the ACPI table fields. =20 This function also performs validations of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiSpcr ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI SRAT table. +/** + This function parses the ACPI SRAT table. When trace is enabled this function parses the SRAT table and traces the ACPI table fields. =20 This function parses the following Resource Allocation Structures: - Processor Local APIC/SAPIC Affinity Structure @@ -705,50 +738,52 @@ ParseAcpiSpcr ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiSrat ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI SSDT table. +/** + This function parses the ACPI SSDT table. When trace is enabled this function parses the SSDT table and traces the ACPI table fields. For the SSDT table only the ACPI header fields are parsed and traced. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiSsdt ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** This function parses the ACPI XSDT table +/** + This function parses the ACPI XSDT table and optionally traces the ACPI table fields. =20 This function also performs validation of the XSDT table. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiXsdt ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c= b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c index 14a8b144114..7b1a02cad3e 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c @@ -1,6 +1,6 @@ -/** +/** @file ACPI table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -16,15 +16,17 @@ #include #include "AcpiParser.h" #include "AcpiTableParser.h" #include "AcpiView.h" =20 -/** A list of registered ACPI table parsers. -*/ +/** + A list of registered ACPI table parsers. +**/ STATIC ACPI_TABLE_PARSER mTableParserList[MAX_ACPI_TABLE_PARSERS]; =20 -/** Register the ACPI table Parser +/** + Register the ACPI table Parser =20 This function registers the ACPI table parser. =20 @param [in] Signature The ACPI table signature. @param [in] ParserProc The ACPI table parser. @@ -33,11 +35,11 @@ STATIC ACPI_TABLE_PARSER mTableParserList[MAX_ACPI_TABL= E_PARSERS]; @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_ALREADY_STARTED The parser for the Table was already registered. @retval EFI_OUT_OF_RESOURCES No space to register the parser. -*/ +**/ EFI_STATUS EFIAPI RegisterParser ( IN UINT32 Signature, IN PARSE_ACPI_TABLE_PROC ParserProc @@ -75,20 +77,21 @@ RegisterParser ( =20 // No free slot found return EFI_OUT_OF_RESOURCES; } =20 -/** Deregister the ACPI table Parser +/** + Deregister the ACPI table Parser =20 This function deregisters the ACPI table parser. =20 @param [in] Signature The ACPI table signature. =20 @retval EFI_SUCCESS The parser was deregistered. @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_NOT_FOUND A registered parser was not found. -*/ +**/ EFI_STATUS EFIAPI DeregisterParser ( IN UINT32 Signature ) @@ -112,22 +115,23 @@ DeregisterParser ( =20 // No matching registered parser found. return EFI_NOT_FOUND; } =20 -/** Get the ACPI table Parser +/** + Get the ACPI table Parser =20 This function returns the ACPI table parser proc from the list of registered parsers. =20 @param [in] Signature The ACPI table signature. @param [out] ParserProc Pointer to a ACPI table parser proc. =20 @retval EFI_SUCCESS The parser was returned successfully. @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_NOT_FOUND A registered parser was not found. -*/ +**/ EFI_STATUS EFIAPI GetParser ( IN UINT32 Signature, OUT PARSE_ACPI_TABLE_PROC * ParserProc @@ -151,11 +155,12 @@ GetParser ( =20 // No matching registered parser found. return EFI_NOT_FOUND; } =20 -/** This function processes the ACPI tables. +/** + This function processes the ACPI tables. This function calls ProcessTableReportOptions() to list the ACPI tables, perform binary dump of the tables and determine if the ACPI fields should be traced. =20 This function also invokes the parser for the ACPI tables. @@ -163,11 +168,11 @@ GetParser ( This function also performs a RAW dump of the ACPI table including the unknown/unparsed ACPI tables and validates the checksum. =20 @param [in] Ptr Pointer to the start of the ACPI table data buffer. -*/ +**/ VOID EFIAPI ProcessAcpiTable ( IN UINT8* Ptr ) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h= b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h index a69d56da6cf..ca33b935760 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h @@ -1,6 +1,6 @@ -/** +/** @file Header file for ACPI table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -12,45 +12,49 @@ **/ =20 #ifndef ACPITABLEPARSER_H_ #define ACPITABLEPARSER_H_ =20 -/** The maximum number of ACPI table parsers. +/** + The maximum number of ACPI table parsers. */ #define MAX_ACPI_TABLE_PARSERS 16 =20 /** An invalid/NULL signature value. */ #define ACPI_PARSER_SIGNATURE_NULL 0 =20 -/** A function that parses the ACPI table. +/** + A function that parses the ACPI table. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ typedef VOID (EFIAPI * PARSE_ACPI_TABLE_PROC) ( IN BOOLEAN Trace, IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -/** The ACPI table parser information -*/ +/** + The ACPI table parser information +**/ typedef struct AcpiTableParser { /// ACPI table signature UINT32 Signature; =20 /// The ACPI table parser function. PARSE_ACPI_TABLE_PROC Parser; } ACPI_TABLE_PARSER; =20 -/** Register the ACPI table Parser +/** + Register the ACPI table Parser =20 This function registers the ACPI table parser. =20 @param [in] Signature The ACPI table signature. @param [in] ParserProc The ACPI table parser. @@ -59,35 +63,37 @@ typedef struct AcpiTableParser { @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_ALREADY_STARTED The parser for the Table was already registered. @retval EFI_OUT_OF_RESOURCES No space to register the parser. -*/ +**/ EFI_STATUS EFIAPI RegisterParser ( IN UINT32 Signature, IN PARSE_ACPI_TABLE_PROC ParserProc -); + ); =20 -/** Deregister the ACPI table Parser +/** + Deregister the ACPI table Parser =20 This function deregisters the ACPI table parser. =20 @param [in] Signature The ACPI table signature. =20 @retval EFI_SUCCESS The parser was deregistered. @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_NOT_FOUND A registered parser was not found. -*/ +**/ EFI_STATUS EFIAPI DeregisterParser ( IN UINT32 Signature -); + ); =20 -/** This function processes the ACPI tables. +/** + This function processes the ACPI tables. This function calls ProcessTableReportOptions() to list the ACPI tables, perform binary dump of the tables and determine if the ACPI fields should be traced. =20 This function also invokes the parser for the ACPI tables. @@ -95,29 +101,30 @@ DeregisterParser ( This function also performs a RAW dump of the ACPI table including the unknown/unparsed ACPI tables and validates the checksum. =20 @param [in] Ptr Pointer to the start of the ACPI table data buffer. -*/ +**/ VOID EFIAPI ProcessAcpiTable ( IN UINT8* Ptr ); =20 -/** Get the ACPI table Parser +/** + Get the ACPI table Parser =20 This function returns the ACPI table parser proc from the list of registered parsers. =20 @param [in] Signature The ACPI table signature. @param [out] ParserProc Pointer to a ACPI table parser proc. =20 @retval EFI_SUCCESS The parser was returned successfully. @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_NOT_FOUND A registered parser was not found. -*/ +**/ EFI_STATUS EFIAPI GetParser ( IN UINT32 Signature, OUT PARSE_ACPI_TABLE_PROC * ParserProc diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index 3bb142538c0..f5602e94291 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -1,6 +1,6 @@ -/** +/** @file =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -33,12 +33,13 @@ STATIC UINT32 mTableCount; STATIC UINT32 mBinTableCount; STATIC BOOLEAN mVerbose; STATIC BOOLEAN mConsistencyCheck; STATIC BOOLEAN mColourHighlighting; =20 -/** An array of acpiview command line parameters. -*/ +/** + An array of acpiview command line parameters. +**/ STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { {L"/?", TypeFlag}, {L"-c", TypeFlag}, {L"-d", TypeFlag}, {L"-h", TypeValue}, @@ -46,66 +47,74 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { {L"-s", TypeValue}, {L"-v", TypeFlag}, {NULL, TypeMax} }; =20 -/** This function returns the colour highlighting status. +/** + This function returns the colour highlighting status. =20 @retval TRUE if colour highlighting is enabled. -*/ +**/ BOOLEAN GetColourHighlighting ( VOID ) { return mColourHighlighting; } =20 -/** This function sets the colour highlighting status. +/** + This function sets the colour highlighting status. =20 -*/ + @param Highlight The Highlight status. + +**/ VOID SetColourHighlighting ( BOOLEAN Highlight ) { mColourHighlighting =3D Highlight; } =20 -/** This function returns the report options. +/** + This function returns the report options. =20 @retval Returns the report option. -*/ +**/ STATIC EREPORT_OPTION GetReportOption ( VOID ) { return mReportType; } =20 -/** This function returns the selected ACPI table. +/** + This function returns the selected ACPI table. =20 @retval Returns signature of the selected ACPI table. -*/ +**/ STATIC UINT32 GetSelectedAcpiTable ( VOID ) { return mSelectedAcpiTable; } =20 -/** This function dumps the ACPI table to a file. +/** + This function dumps the ACPI table to a file. + @param [in] Ptr Pointer to the ACPI table data. @param [in] Length The length of the ACPI table. =20 @retval TRUE Success. @retval FALSE Failure. -*/ +**/ STATIC BOOLEAN DumpAcpiTableToFile ( IN CONST UINT8* Ptr, IN CONST UINTN Length @@ -158,18 +167,19 @@ DumpAcpiTableToFile ( =20 ShellCloseFile (&DumpFileHandle); return (Length =3D=3D TransferBytes); } =20 -/** This function processes the table reporting options for the ACPI table. +/** + This function processes the table reporting options for the ACPI table. =20 @param [in] Signature The ACPI table Signature. @param [in] TablePtr Pointer to the ACPI table data. @param [in] Length The length fo the ACPI table. =20 @retval Returns TRUE if the ACPI table should be traced. -*/ +**/ BOOLEAN ProcessTableReportOptions ( IN CONST UINT32 Signature, IN CONST UINT8* TablePtr, IN CONST UINT32 Length @@ -247,17 +257,18 @@ ProcessTableReportOptions ( } =20 return Log; } =20 -/** This function converts a string to ACPI table signature. +/** + This function converts a string to ACPI table signature. =20 @param [in] Str Pointer to the string to be converted to the ACPI table signature. =20 @retval The ACPI table signature. -*/ +**/ STATIC UINT32 ConvertStrToAcpiSignature ( IN CONST CHAR16* Str ) @@ -275,20 +286,20 @@ ConvertStrToAcpiSignature ( Index++; } return *(UINT32*)Ptr; } =20 -/** This function iterates the configuration table entries in the - system table, retrieves the RSDP pointer and starts parsing - the ACPI tables. +/** + This function iterates the configuration table entries in the + system table, retrieves the RSDP pointer and starts parsing the ACPI tab= les. =20 @param [in] SystemTable Pointer to the EFI system table. =20 @retval Returns EFI_NOT_FOUND if the RSDP pointer is not found. Returns EFI_UNSUPPORTED if the RSDP version is less than 2. Returns EFI_SUCCESS if successful. -*/ +**/ STATIC EFI_STATUS EFIAPI AcpiView ( IN EFI_SYSTEM_TABLE* SystemTable @@ -404,11 +415,11 @@ AcpiView ( /** Function for 'acpiview' command. =20 @param[in] ImageHandle Handle to the Image (NULL if Internal). @param[in] SystemTable Pointer to the System Table (NULL if Internal). -*/ +**/ SHELL_STATUS EFIAPI ShellCommandRunAcpiView ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE* SystemTable diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h index 03561ea8168..b035395a721 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h @@ -1,6 +1,6 @@ -/** +/** @file Header file for AcpiView =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -12,89 +12,102 @@ **/ =20 #ifndef ACPIVIEW_H_ #define ACPIVIEW_H_ =20 -/** A macro to define the max file name length -*/ +/** + A macro to define the max file name length +**/ #define MAX_FILE_NAME_LEN 128 =20 -/** Offset to the RSDP revision from the start of the RSDP -*/ +/** + Offset to the RSDP revision from the start of the RSDP +**/ #define RSDP_REVISION_OFFSET 15 =20 -/** Offset to the RSDP length from the start of the RSDP -*/ +/** + Offset to the RSDP length from the start of the RSDP +**/ #define RSDP_LENGTH_OFFSET 20 =20 -/** The EREPORT_OPTION enum describes ACPI table Reporting options. -*/ +/** + The EREPORT_OPTION enum describes ACPI table Reporting options. +**/ typedef enum ReportOption { EREPORT_ALL, ///< Report All tables. EREPORT_SELECTED, ///< Report Selected table. EREPORT_TABLE_LIST, ///< Report List of tables. EREPORT_DUMP_BIN_FILE, ///< Dump selected table to a file. EREPORT_MAX } EREPORT_OPTION; =20 -/** This function resets the ACPI table error counter to Zero. -*/ +/** + This function resets the ACPI table error counter to Zero. +**/ VOID ResetErrorCount ( VOID ); =20 -/** This function returns the ACPI table error count. +/** + This function returns the ACPI table error count. =20 @retval Returns the count of errors detected in the ACPI tables. -*/ +**/ UINT32 GetErrorCount ( VOID ); =20 -/** This function resets the ACPI table warning counter to Zero. -*/ +/** + This function resets the ACPI table warning counter to Zero. +**/ VOID ResetWarningCount ( VOID ); =20 -/** This function returns the ACPI table warning count. +/** + This function returns the ACPI table warning count. =20 @retval Returns the count of warning detected in the ACPI tables. -*/ +**/ UINT32 GetWarningCount ( VOID ); =20 -/** This function returns the colour highlighting status. +/** + This function returns the colour highlighting status. =20 @retval TRUE if colour highlighting is enabled. -*/ +**/ BOOLEAN GetColourHighlighting ( VOID ); =20 -/** This function sets the colour highlighting status. +/** + This function sets the colour highlighting status. + + @param Highlight The Highlight status. =20 -*/ +**/ VOID SetColourHighlighting ( BOOLEAN Highlight ); =20 -/** This function processes the table reporting options for the ACPI table. +/** + This function processes the table reporting options for the ACPI table. =20 @param [in] Signature The ACPI table Signature. @param [in] TablePtr Pointer to the ACPI table data. @param [in] Length The length fo the ACPI table. =20 @retval Returns TRUE if the ACPI table should be traced. -*/ +**/ BOOLEAN ProcessTableReportOptions ( IN CONST UINT32 Signature, IN CONST UINT8* TablePtr, IN CONST UINT32 Length diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Bgrt/Bgrt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Bgrt/BgrtPa= rser.c index 0b3f9a79012..c7249d7eef6 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Bgrt/BgrtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Bgrt/BgrtParser.c @@ -1,6 +1,6 @@ -/** +/** @file BGRT table parser =20 Copyright (c) 2017 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -20,33 +20,35 @@ #include "AcpiTableParser.h" =20 // Local variables STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** An ACPI_PARSER array describing the ACPI BDRT Table. -*/ +/** + An ACPI_PARSER array describing the ACPI BDRT Table. +**/ STATIC CONST ACPI_PARSER BgrtParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"Version", 2, 36, L"0x%x", NULL, NULL, NULL, NULL}, {L"Status", 1, 38, L"0x%x", NULL, NULL, NULL, NULL}, {L"Image Type", 1, 39, L"0x%x", NULL, NULL, NULL, NULL}, {L"Image Address", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Image Offset X", 4, 48, L"%d", NULL, NULL, NULL, NULL}, {L"Image Offset Y", 4, 52, L"%d", NULL, NULL, NULL, NULL} }; =20 -/** This function parses the ACPI BGRT table. +/** + This function parses the ACPI BGRT table. When trace is enabled this function parses the BGRT table and traces the ACPI table fields. =20 This function also performs validation of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiBgrt ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Pa= rser.c index f70a1328cc9..7f66bce074e 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c @@ -1,6 +1,6 @@ -/** +/** @file DBG2 table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -30,30 +30,32 @@ STATIC CONST UINT16* OEMDataLength; STATIC CONST UINT16* OEMDataOffset; STATIC CONST UINT16* BaseAddrRegOffset; STATIC CONST UINT16* AddrSizeOffset; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** This function Validates the NameSpace string length. +/** + This function Validates the NameSpace string length. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateNameSpaceStrLen ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** This function parses the debug device information structure. +/** + This function parses the debug device information structure. =20 @param [in] Ptr Pointer to the start of the buffer. @param [out] Length Pointer in which the length of the debug device information is returned. -*/ +**/ STATIC VOID EFIAPI DumpDbgDeviceInfo ( IN UINT8* Ptr, @@ -93,16 +95,17 @@ STATIC CONST ACPI_PARSER DbgDevInfoParser[] =3D { (VOID**)&BaseAddrRegOffset, NULL, NULL}, {L"Address Size Offset", 2, 20, L"0x%x", NULL, (VOID**)&AddrSizeOffset, NULL, NULL} }; =20 -/** This function validates the NameSpace string length. +/** + This function validates the NameSpace string length. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateNameSpaceStrLen ( IN UINT8* Ptr, @@ -118,16 +121,17 @@ ValidateNameSpaceStrLen ( NameSpaceStrLen ); } } =20 -/** This function parses the debug device information structure. +/** + This function parses the debug device information structure. =20 @param [in] Ptr Pointer to the start of the buffer. - @param [out] Ptr Pointer in which the length of the debug + @param [out] Length Pointer in which the length of the debug device information is returned. -*/ +**/ STATIC VOID EFIAPI DumpDbgDeviceInfo ( IN UINT8* Ptr, @@ -191,21 +195,22 @@ DumpDbgDeviceInfo ( } =20 *Length =3D *DbgDevInfoLen; } =20 -/** This function parses the ACPI DBG2 table. +/** + This function parses the ACPI DBG2 table. When trace is enabled this function parses the DBG2 table and traces the ACPI table fields. =20 This function also performs validation of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiDbg2 ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/Dsdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtPa= rser.c index ef459a12099..f1935f714c8 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c @@ -1,6 +1,6 @@ -/** +/** @file DSDT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -17,21 +17,22 @@ #include #include #include "AcpiParser.h" #include "AcpiTableParser.h" =20 -/** This function parses the ACPI DSDT table. +/** + This function parses the ACPI DSDT table. When trace is enabled this function parses the DSDT table and traces the ACPI table fields. For the DSDT table only the ACPI header fields are parsed and traced. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiDsdt ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/Fadt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtPa= rser.c index fdccb2ac3bd..cca25fcce90 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Fadt/FadtParser.c @@ -1,6 +1,6 @@ -/** +/** @file FADT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -23,47 +23,72 @@ STATIC CONST UINT32* DsdtAddress; STATIC CONST UINT64* X_DsdtAddress; STATIC CONST UINT8* FadtMinorRevision; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** A macro defining the Hardware reduced ACPI flag -*/ +/** + A macro defining the Hardware reduced ACPI flag +**/ #define HW_REDUCED_ACPI BIT20 =20 -// Forward declarations +/** + Get the ACPI XSDT header info. +**/ CONST ACPI_DESCRIPTION_HEADER_INFO* CONST EFIAPI GetAcpiXsdtHeaderInfo ( VOID -); + ); =20 +/** + This function validates the Firmware Control Field. + + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ STATIC VOID EFIAPI ValidateFirmwareCtrl ( IN UINT8* Ptr, IN VOID* Context -); + ); + +/** + This function validates the X_Firmware Control Field. =20 + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ STATIC VOID EFIAPI ValidateXFirmwareCtrl ( IN UINT8* Ptr, IN VOID* Context -); + ); =20 +/** + This function validates the flags. + + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ STATIC VOID EFIAPI ValidateFlags ( IN UINT8* Ptr, IN VOID* Context -); + ); =20 -/** An ACPI_PARSER array describing the ACPI FADT Table. -*/ +/** + An ACPI_PARSER array describing the ACPI FADT Table. +**/ STATIC CONST ACPI_PARSER FadtParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"FIRMWARE_CTRL", 4, 36, L"0x%x", NULL, NULL, ValidateFirmwareCtrl, NUL= L}, {L"DSDT", 4, 40, L"0x%x", NULL, (VOID**)&DsdtAddress, NULL, NULL}, {L"Reserved", 1, 44, L"%x", NULL, NULL, NULL, NULL}, @@ -121,16 +146,17 @@ STATIC CONST ACPI_PARSER FadtParser[] =3D { {L"SLEEP_CONTROL_REG", 12, 244, NULL, DumpGas, NULL, NULL, NULL}, {L"SLEEP_STATUS_REG", 12, 256, NULL, DumpGas, NULL, NULL, NULL}, {L"Hypervisor VendorIdentity", 8, 268, L"%lx", NULL, NULL, NULL, NULL} }; =20 -/** This function validates the Firmware Control Field. +/** + This function validates the Firmware Control Field. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateFirmwareCtrl ( IN UINT8* Ptr, @@ -145,16 +171,17 @@ ValidateFirmwareCtrl ( ); } #endif } =20 -/** This function validates the X_Firmware Control Field. +/** + This function validates the X_Firmware Control Field. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateXFirmwareCtrl ( IN UINT8* Ptr, @@ -169,16 +196,17 @@ ValidateXFirmwareCtrl ( ); } #endif } =20 -/** This function validates the flags. +/** + This function validates the flags. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateFlags ( IN UINT8* Ptr, @@ -193,21 +221,21 @@ ValidateFlags ( ); } #endif } =20 -/** This function parses the ACPI FADT table. - This function parses the FADT table and optionally traces the ACPI - table fields. +/** + This function parses the ACPI FADT table. + This function parses the FADT table and optionally traces the ACPI table= fields. =20 This function also performs validation of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiFadt ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/Gtdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtPa= rser.c index ce96604ee6f..30cf3e14f7e 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c @@ -1,6 +1,6 @@ -/** +/** @file GTDT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -27,26 +27,28 @@ STATIC CONST UINT16* PlatformTimerLength; STATIC CONST UINT32* GtBlockTimerCount; STATIC CONST UINT32* GtBlockTimerOffset; STATIC CONST UINT16* GtBlockLength; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** This function validates the GT Block timer count. +/** + This function validates the GT Block timer count. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateGtBlockTimerCount ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** An ACPI_PARSER array describing the ACPI GTDT Table. -*/ +/** + An ACPI_PARSER array describing the ACPI GTDT Table. +**/ STATIC CONST ACPI_PARSER GtdtParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"CntControlBase Physical Address", 8, 36, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Reserved", 4, 44, L"0x%x", NULL, NULL, NULL, NULL}, @@ -67,20 +69,22 @@ STATIC CONST ACPI_PARSER GtdtParser[] =3D { (VOID**)&GtdtPlatformTimerCount, NULL, NULL}, {L"Platform Timer Offset", 4, 92, L"0x%x", NULL, (VOID**)&GtdtPlatformTimerOffset, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the Platform timer header. -*/ +/** + An ACPI_PARSER array describing the Platform timer header. +**/ STATIC CONST ACPI_PARSER GtPlatformTimerHeaderParser[] =3D { {L"Type", 1, 0, NULL, NULL, (VOID**)&PlatformTimerType, NULL, NULL}, {L"Length", 2, 1, NULL, NULL, (VOID**)&PlatformTimerLength, NULL, NULL}, {L"Reserved", 1, 3, NULL, NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the Platform GT Block. -*/ +/** + An ACPI_PARSER array describing the Platform GT Block. +**/ STATIC CONST ACPI_PARSER GtBlockParser[] =3D { {L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL}, {L"Length", 2, 1, L"%d", NULL, (VOID**)&GtBlockLength, NULL, NULL}, {L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL}, {L"Physical address (CntCtlBase)", 8, 4, L"0x%lx", NULL, NULL, NULL, NUL= L}, @@ -88,12 +92,13 @@ STATIC CONST ACPI_PARSER GtBlockParser[] =3D { ValidateGtBlockTimerCount, NULL}, {L"Timer Offset", 4, 16, L"%d", NULL, (VOID**)&GtBlockTimerOffset, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the GT Block timer. -*/ +/** + An ACPI_PARSER array describing the GT Block timer. +**/ STATIC CONST ACPI_PARSER GtBlockTimerParser[] =3D { {L"Frame Number", 1, 0, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 3, 1, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}, {L"Physical address (CntBaseX)", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Physical address (CntEL0BaseX)", 8, 12, L"0x%lx", NULL, NULL, NULL, @@ -103,28 +108,30 @@ STATIC CONST ACPI_PARSER GtBlockTimerParser[] =3D { {L"Virtual Timer GSIV", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, {L"Virtual Timer Flags", 4, 32, L"0x%x", NULL, NULL, NULL, NULL}, {L"Common Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the Platform Watchdog. -*/ +/** + An ACPI_PARSER array describing the Platform Watchdog. +**/ STATIC CONST ACPI_PARSER SBSAGenericWatchdogParser[] =3D { {L"Type", 1, 0, L"%d", NULL, NULL, NULL, NULL}, {L"Length", 2, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 1, 3, L"%x", NULL, NULL, NULL, NULL}, {L"RefreshFrame Physical address", 8, 4, L"0x%lx", NULL, NULL, NULL, NUL= L}, {L"ControlFrame Physical address", 8, 12, L"0x%lx", NULL, NULL, NULL, NU= LL}, {L"Watchdog Timer GSIV", 4, 20, L"0x%x", NULL, NULL, NULL, NULL}, {L"Watchdog Timer Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** This function validates the GT Block timer count. +/** + This function validates the GT Block timer count. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateGtBlockTimerCount ( IN UINT8* Ptr, @@ -139,15 +146,16 @@ ValidateGtBlockTimerCount ( BlockTimerCount ); } } =20 -/** This function parses the Platform GT Block. +/** + This function parses the Platform GT Block. =20 @param [in] Ptr Pointer to the start of the GT Block data. @param [in] Length Length of the GT Block structure. -*/ +**/ STATIC VOID DumpGTBlock ( IN UINT8* Ptr, IN UINT16 Length @@ -194,15 +202,16 @@ DumpGTBlock ( ); } } } =20 -/** This function parses the Platform Watchdog timer. +/** + This function parses the Platform Watchdog timer. =20 @param [in] Ptr Pointer to the start of the watchdog timer data. @param [in] Length Length of the watchdog timer structure. -*/ +**/ STATIC VOID DumpWatchdogTimer ( IN UINT8* Ptr, IN UINT16 Length @@ -216,11 +225,12 @@ DumpWatchdogTimer ( Length, PARSER_PARAMS (SBSAGenericWatchdogParser) ); } =20 -/** This function parses the ACPI GTDT table. +/** + This function parses the ACPI GTDT table. When trace is enabled this function parses the GTDT table and traces the ACPI table fields. =20 This function also parses the following platform timer structures: - GT Block timer @@ -230,11 +240,11 @@ DumpWatchdogTimer ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiGtdt ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Iort= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortPa= rser.c index 503a745718d..704dfc407cc 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c @@ -1,6 +1,6 @@ -/** +/** @file IORT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -21,12 +21,13 @@ #include "AcpiTableParser.h" =20 // Local variables STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** The EIORT_NODE enum describes the IORT Node types. -*/ +/** + The EIORT_NODE enum describes the IORT Node types. +**/ typedef enum IortNode { EIORT_NODE_ITS_GROUP, ///< ITS Group node EIORT_NODE_NAMED_COMPONENT, ///< Named Component node EIORT_NODE_ROOT_COMPLEX, ///< Root Complex node EIORT_NODE_SMMUV1_V2, ///< SMMU v1/v2 node @@ -49,46 +50,48 @@ STATIC CONST UINT32* InterruptContextOffset; STATIC CONST UINT32* PmuInterruptCount; STATIC CONST UINT32* PmuInterruptOffset; =20 STATIC CONST UINT32* ItsCount; =20 -/** This function validates the ID Mapping array count for the ITS node. +/** + This function validates the ID Mapping array count for the ITS node. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateItsIdMappingCount ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** This function validates the ID Mapping array offset for the ITS node. +/** + This function validates the ID Mapping array offset for the ITS node. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateItsIdArrayReference ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** Helper Macro for populating the IORT Node header in the ACPI_PARSER - array. +/** + Helper Macro for populating the IORT Node header in the ACPI_PARSER arra= y. =20 @param [out] ValidateIdMappingCount Optional pointer to a function for validating the ID Mapping count. @param [out] ValidateIdArrayReference Optional pointer to a function for validating the ID Array reference. -*/ +**/ #define PARSE_IORT_NODE_HEADER(ValidateIdMappingCount, \ ValidateIdArrayReference) \ { L"Type", 1, 0, L"%d", NULL, (VOID**)&IortNodeType, NULL, NULL }, \ { L"Length", 2, 1, L"%d", NULL, (VOID**)&IortNodeLength, NULL, NULL }, \ { L"Revision", 1, 3, L"%d", NULL, NULL, NULL, NULL }, \ @@ -96,29 +99,32 @@ ValidateItsIdArrayReference ( { L"Number of ID mappings", 4, 8, L"%d", NULL, \ (VOID**)&IortIdMappingCount, ValidateIdMappingCount, NULL }, \ { L"Reference to ID Array", 4, 12, L"0x%x", NULL, \ (VOID**)&IortIdMappingOffset, ValidateIdArrayReference, NULL } =20 -/** An ACPI_PARSER array describing the ACPI IORT Table -*/ +/** + An ACPI_PARSER array describing the ACPI IORT Table +**/ STATIC CONST ACPI_PARSER IortParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"Number of IORT Nodes", 4, 36, L"%d", NULL, (VOID**)&IortNodeCount, NULL, NULL}, {L"Offset to Array of IORT Nodes", 4, 40, L"0x%x", NULL, (VOID**)&IortNodeOffset, NULL, NULL}, {L"Reserved", 4, 44, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the IORT node header structure. -*/ +/** + An ACPI_PARSER array describing the IORT node header structure. +**/ STATIC CONST ACPI_PARSER IortNodeHeaderParser[] =3D { PARSE_IORT_NODE_HEADER (NULL, NULL) }; =20 -/** An ACPI_PARSER array describing the IORT SMMUv1/2 node. -*/ +/** + An ACPI_PARSER array describing the IORT SMMUv1/2 node. +**/ STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] =3D { PARSE_IORT_NODE_HEADER (NULL, NULL), {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Span", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Model", 4, 32, L"%d", NULL, NULL, NULL, NULL}, @@ -139,29 +145,32 @@ STATIC CONST ACPI_PARSER IortNodeSmmuV1V2Parser[] =3D= { {L"SMMU_NSgIrpt interrupt flags", 4, 64, L"0x%x", NULL, NULL, NULL, NULL= }, {L"SMMU_NSgCfgIrpt", 4, 68, L"0x%x", NULL, NULL, NULL, NULL}, {L"SMMU_NSgCfgIrpt interrupt flags", 4, 72, L"0x%x", NULL, NULL, NULL, N= ULL} }; =20 -/** An ACPI_PARSER array describing the SMMUv1/2 Node Interrupt Array. -*/ +/** + An ACPI_PARSER array describing the SMMUv1/2 Node Interrupt Array. +**/ STATIC CONST ACPI_PARSER InterruptArrayParser[] =3D { {L" Interrupt GSIV", 4, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L" Flags", 4, 4, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the IORT ID Mapping. -*/ +/** + An ACPI_PARSER array describing the IORT ID Mapping. +**/ STATIC CONST ACPI_PARSER IortNodeIdMappingParser[] =3D { {L" Input base", 4, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L" Number of IDs", 4, 4, L"0x%x", NULL, NULL, NULL, NULL}, {L" Output base", 4, 8, L"0x%x", NULL, NULL, NULL, NULL}, {L" Output reference", 4, 12, L"0x%x", NULL, NULL, NULL, NULL}, {L" Flags", 4, 16, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the IORT SMMUv3 node. -*/ +/** + An ACPI_PARSER array describing the IORT SMMUv3 node. +**/ STATIC CONST ACPI_PARSER IortNodeSmmuV3Parser[] =3D { PARSE_IORT_NODE_HEADER (NULL, NULL), {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Flags", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}, {L"Reserved", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, @@ -171,79 +180,86 @@ STATIC CONST ACPI_PARSER IortNodeSmmuV3Parser[] =3D { {L"PRI", 4, 48, L"0x%x", NULL, NULL, NULL, NULL}, {L"GERR", 4, 52, L"0x%x", NULL, NULL, NULL, NULL}, {L"Sync", 4, 56, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the IORT ITS node. -*/ +/** + An ACPI_PARSER array describing the IORT ITS node. +**/ STATIC CONST ACPI_PARSER IortNodeItsParser[] =3D { PARSE_IORT_NODE_HEADER ( ValidateItsIdMappingCount, ValidateItsIdArrayReference ), {L" Number of ITSs", 4, 16, L"%d", NULL, (VOID**)&ItsCount, NULL} }; =20 -/** An ACPI_PARSER array describing the ITS ID. -*/ +/** + An ACPI_PARSER array describing the ITS ID. +**/ STATIC CONST ACPI_PARSER ItsIdParser[] =3D { { L" GIC ITS Identifier", 4, 0, L"%d", NULL, NULL, NULL } }; =20 -/** An ACPI_PARSER array describing the IORT Names Component node. -*/ +/** + An ACPI_PARSER array describing the IORT Names Component node. +**/ STATIC CONST ACPI_PARSER IortNodeNamedComponentParser[] =3D { PARSE_IORT_NODE_HEADER (NULL, NULL), {L"Node Flags", 4, 16, L"%d", NULL, NULL, NULL, NULL}, {L"Memory access properties", 8, 20, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Device memory address size limit", 1, 28, L"%d", NULL, NULL, NULL, NU= LL} }; =20 -/** An ACPI_PARSER array describing the IORT Root Complex node. -*/ +/** + An ACPI_PARSER array describing the IORT Root Complex node. +**/ STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] =3D { PARSE_IORT_NODE_HEADER (NULL, NULL), {L"Memory access properties", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"ATS Attribute", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}, {L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the IORT PMCG node. -*/ +/** + An ACPI_PARSER array describing the IORT PMCG node. +**/ STATIC CONST ACPI_PARSER IortNodePmcgParser[] =3D { PARSE_IORT_NODE_HEADER (NULL, NULL), {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Overflow interrupt GSIV", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}, {L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, }; =20 -/** This function validates the ID Mapping array count for the ITS node. +/** + This function validates the ID Mapping array count for the ITS node. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateItsIdMappingCount ( IN UINT8* Ptr, - VOID* Context + IN VOID* Context ) { if (*(UINT32*)Ptr !=3D 0) { IncrementErrorCount (); Print (L"\nERROR: IORT ID Mapping count must be zero."); } } =20 -/** This function validates the ID Mapping array offset for the ITS node. +/** + This function validates the ID Mapping array offset for the ITS node. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateItsIdArrayReference ( IN UINT8* Ptr, @@ -254,17 +270,18 @@ ValidateItsIdArrayReference ( IncrementErrorCount (); Print (L"\nERROR: IORT ID Mapping offset must be zero."); } } =20 -/** This function parses the IORT Node Id Mapping array. +/** + This function parses the IORT Node Id Mapping array. =20 @param [in] Ptr Pointer to the start of the IORT Table. @param [in] MappingCount The ID Mapping count. @param [in] MappingOffset The offset of the ID Mapping array from the start of the IORT table. -*/ +**/ STATIC VOID DumpIortNodeIdMappings ( IN UINT8* Ptr, IN UINT32 MappingCount, @@ -296,18 +313,19 @@ DumpIortNodeIdMappings ( IdMappingPtr +=3D Offset; Index++; } } =20 -/** This function parses the IORT SMMUv1/2 node. +/** + This function parses the IORT SMMUv1/2 node. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Length Length of the buffer. @param [in] MappingCount The ID Mapping count. @param [in] MappingOffset The offset of the ID Mapping array from the start of the IORT table. -*/ +**/ STATIC VOID DumpIortNodeSmmuV1V2 ( IN UINT8* Ptr, IN UINT16 Length, @@ -375,18 +393,19 @@ DumpIortNodeSmmuV1V2 ( if (*IortIdMappingCount !=3D 0) { DumpIortNodeIdMappings (Ptr, MappingCount, MappingOffset); } } =20 -/** This function parses the IORT SMMUv3 node. +/** + This function parses the IORT SMMUv3 node. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Length Length of the buffer. @param [in] MappingCount The ID Mapping count. @param [in] MappingOffset The offset of the ID Mapping array from the start of the IORT table. -*/ +**/ STATIC VOID DumpIortNodeSmmuV3 ( IN UINT8* Ptr, IN UINT16 Length, @@ -406,15 +425,16 @@ DumpIortNodeSmmuV3 ( if (*IortIdMappingCount !=3D 0) { DumpIortNodeIdMappings (Ptr, MappingCount, MappingOffset); } } =20 -/** This function parses the IORT ITS node. +/** + This function parses the IORT ITS node. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Length Length of the buffer. -*/ +**/ STATIC VOID DumpIortNodeIts ( IN UINT8* Ptr, IN UINT16 Length @@ -456,18 +476,19 @@ DumpIortNodeIts ( } =20 // Note: ITS does not have the ID Mappings Array } =20 -/** This function parses the IORT Named Component node. +/** + This function parses the IORT Named Component node. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Length Length of the buffer. @param [in] MappingCount The ID Mapping count. @param [in] MappingOffset The offset of the ID Mapping array from the start of the IORT table. -*/ +**/ STATIC VOID DumpIortNodeNamedComponent ( IN UINT8* Ptr, IN UINT16 Length, @@ -502,18 +523,19 @@ DumpIortNodeNamedComponent ( if (*IortIdMappingCount !=3D 0) { DumpIortNodeIdMappings (Ptr, MappingCount, MappingOffset); } } =20 -/** This function parses the IORT Root Complex node. +/** + This function parses the IORT Root Complex node. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Length Length of the buffer. @param [in] MappingCount The ID Mapping count. @param [in] MappingOffset The offset of the ID Mapping array from the start of the IORT table. -*/ +**/ STATIC VOID DumpIortNodeRootComplex ( IN UINT8* Ptr, IN UINT16 Length, @@ -533,18 +555,19 @@ DumpIortNodeRootComplex ( if (*IortIdMappingCount !=3D 0) { DumpIortNodeIdMappings (Ptr, MappingCount, MappingOffset); } } =20 -/** This function parses the IORT PMCG node. +/** + This function parses the IORT PMCG node. =20 @param [in] Ptr Pointer to the start of the buffer. @param [in] Length Length of the buffer. @param [in] MappingCount The ID Mapping count. @param [in] MappingOffset The offset of the ID Mapping array from the start of the IORT table. -*/ +**/ STATIC VOID DumpIortNodePmcg ( IN UINT8* Ptr, IN UINT16 Length, @@ -572,13 +595,13 @@ DumpIortNodePmcg ( *IortIdMappingCount ); } } =20 -/** This function parses the ACPI IORT table. - When trace is enabled this function parses the IORT table and - traces the ACPI fields. +/** + This function parses the ACPI IORT table. + When trace is enabled this function parses the IORT table and traces the= ACPI fields. =20 This function also parses the following nodes: - ITS Group - Named Component - Root Complex @@ -590,11 +613,11 @@ DumpIortNodePmcg ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiIort ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/Madt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPa= rser.c index 2ccbb7b80ed..3ac27086a6b 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c @@ -1,6 +1,6 @@ -/** +/** @file MADT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -22,22 +22,28 @@ // Local Variables STATIC CONST UINT8* MadtInterruptControllerType; STATIC CONST UINT8* MadtInterruptControllerLength; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -// Forward declarations +/** + This function validates the System Vector Base in the GICD. + + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ STATIC VOID EFIAPI ValidateGICDSystemVectorBase ( IN UINT8* Ptr, IN VOID* Context -); + ); =20 -/** An ACPI_PARSER array describing the GICC Interrupt - Controller Structure. -*/ +/** + An ACPI_PARSER array describing the GICC Interrupt Controller Structure. +**/ STATIC CONST ACPI_PARSER GicCParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL}, =20 @@ -57,13 +63,13 @@ STATIC CONST ACPI_PARSER GicCParser[] =3D { {L"Processor Power Efficiency Class", 1, 76, L"0x%x", NULL, NULL, NULL, NULL}, {L"Reserved", 3, 77, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the GICD Interrupt - Controller Structure. -*/ +/** + An ACPI_PARSER array describing the GICD Interrupt Controller Structure. +**/ STATIC CONST ACPI_PARSER GicDParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL}, =20 @@ -73,13 +79,13 @@ STATIC CONST ACPI_PARSER GicDParser[] =3D { ValidateGICDSystemVectorBase, NULL}, {L"GIC Version", 1, 20, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 3, 21, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the MSI Frame Interrupt - Controller Structure. -*/ +/** + An ACPI_PARSER array describing the MSI Frame Interrupt Controller Struc= ture. +**/ STATIC CONST ACPI_PARSER GicMSIFrameParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL}, =20 @@ -89,61 +95,63 @@ STATIC CONST ACPI_PARSER GicMSIFrameParser[] =3D { =20 {L"SPI Count", 2, 20, L"%d", NULL, NULL, NULL, NULL}, {L"SPI Base", 2, 22, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the GICR Interrupt - Controller Structure. -*/ +/** + An ACPI_PARSER array describing the GICR Interrupt Controller Structure. +**/ STATIC CONST ACPI_PARSER GicRParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL}, =20 {L"Discovery Range Base Address", 8, 4, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Discovery Range Length", 4, 12, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the GIC ITS Interrupt - Controller Structure. -*/ +/** + An ACPI_PARSER array describing the GIC ITS Interrupt Controller Structu= re. +**/ STATIC CONST ACPI_PARSER GicITSParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL}, =20 {L"GIC ITS ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL}, {L"Physical Base Address", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the ACPI MADT Table. -*/ +/** + An ACPI_PARSER array describing the ACPI MADT Table. +**/ STATIC CONST ACPI_PARSER MadtParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"Local Interrupt Controller Address", 4, 36, L"0x%x", NULL, NULL, NULL, NULL}, {L"Flags", 4, 40, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the MADT Interrupt - Controller Structure Header Structure. -*/ +/** + An ACPI_PARSER array describing the MADT Interrupt Controller Structure = Header Structure. +**/ STATIC CONST ACPI_PARSER MadtInterruptControllerHeaderParser[] =3D { {NULL, 1, 0, NULL, NULL, (VOID**)&MadtInterruptControllerType, NULL, NUL= L}, {L"Length", 1, 1, NULL, NULL, (VOID**)&MadtInterruptControllerLength, NU= LL, NULL}, {L"Reserved", 2, 2, NULL, NULL, NULL, NULL, NULL} }; =20 -/** This function validates the System Vector Base in the GICD. +/** + This function validates the System Vector Base in the GICD. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateGICDSystemVectorBase ( IN UINT8* Ptr, @@ -156,11 +164,12 @@ ValidateGICDSystemVectorBase ( L"\nERROR: System Vector Base must be zero." ); } } =20 -/** This function parses the ACPI MADT table. +/** + This function parses the ACPI MADT table. When trace is enabled this function parses the MADT table and traces the ACPI table fields. =20 This function currently parses the following Interrupt Controller Structures: @@ -174,11 +183,11 @@ ValidateGICDSystemVectorBase ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiMadt ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Mcfg/Mcfg= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Mcfg/McfgPa= rser.c index a21b30dc0d5..29fc28f7fb0 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Mcfg/McfgParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Mcfg/McfgParser.c @@ -1,6 +1,6 @@ -/** +/** @file MCFG table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -20,39 +20,41 @@ #include "AcpiTableParser.h" =20 // Local variables STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** An ACPI_PARSER array describing the ACPI MCFG Table. -*/ +/** + An ACPI_PARSER array describing the ACPI MCFG Table. +**/ STATIC CONST ACPI_PARSER McfgParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"Reserved", 8, 36, L"0x%lx", NULL, NULL, NULL, NULL}, }; =20 -/** An ACPI_PARSER array describing the PCI configuration Space - Base Address structure. -*/ +/** + An ACPI_PARSER array describing the PCI configuration Space Base Address= structure. +**/ STATIC CONST ACPI_PARSER PciCfgSpaceBaseAddrParser[] =3D { {L"Base Address", 8, 0, L"0x%lx", NULL, NULL, NULL, NULL}, {L"PCI Segment Group No.", 2, 8, L"0x%x", NULL, NULL, NULL, NULL}, {L"Start Bus No.", 1, 10, L"0x%x", NULL, NULL, NULL, NULL}, {L"End Bus No.", 1, 11, L"0x%x", NULL, NULL, NULL, NULL}, {L"Reserved", 4, 12, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** This function parses the ACPI MCFG table. +/** + This function parses the ACPI MCFG table. When trace is enabled this function parses the MCFG table and traces the ACPI table fields. =20 This function also performs validation of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiMcfg ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/Rsdp= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpPa= rser.c index c7acdceb947..c33bb1e9234 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c @@ -1,6 +1,6 @@ -/** +/** @file RSDP table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -19,40 +19,43 @@ #include "AcpiTableParser.h" =20 // Local Variables STATIC CONST UINT64* XsdtAddress; =20 -/** This function validates the RSDT Address. +/** + This function validates the RSDT Address. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateRsdtAddress ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** This function validates the XSDT Address. +/** + This function validates the XSDT Address. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateXsdtAddress ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** An array describing the ACPI RSDP Table. -*/ +/** + An array describing the ACPI RSDP Table. +**/ STATIC CONST ACPI_PARSER RsdpParser[] =3D { {L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL}, {L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL}, {L"Oem ID", 6, 9, NULL, Dump6Chars, NULL, NULL, NULL}, {L"Revision", 1, 15, L"%d", NULL, NULL, NULL, NULL}, @@ -62,16 +65,17 @@ STATIC CONST ACPI_PARSER RsdpParser[] =3D { ValidateXsdtAddress, NULL}, {L"Extended Checksum", 1, 32, L"0x%x", NULL, NULL, NULL, NULL}, {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL} }; =20 -/** This function validates the RSDT Address. +/** + This function validates the RSDT Address. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateRsdtAddress ( IN UINT8* Ptr, @@ -93,16 +97,17 @@ ValidateRsdtAddress ( ); } #endif } =20 -/** This function validates the XSDT Address. +/** + This function validates the XSDT Address. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateXsdtAddress ( IN UINT8* Ptr, @@ -124,11 +129,12 @@ ValidateXsdtAddress ( ); } #endif } =20 -/** This function parses the ACPI RSDP table. +/** + This function parses the ACPI RSDP table. =20 This function invokes the parser for the XSDT table. * Note - This function does not support parsing of RSDT table. =20 This function also performs a RAW dump of the ACPI table and @@ -136,11 +142,11 @@ ValidateXsdtAddress ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiRsdp ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/Slit= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitPa= rser.c index 5f99fd46a03..a028ae541ca 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c @@ -1,6 +1,6 @@ -/** +/** @file SLIT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -22,23 +22,26 @@ =20 // Local Variables STATIC CONST UINT64* SlitSystemLocalityCount; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** An ACPI_PARSER array describing the ACPI SLIT table. -*/ +/** + An ACPI_PARSER array describing the ACPI SLIT table. +**/ STATIC CONST ACPI_PARSER SlitParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"Number of System Localities", 8, 36, L"0x%lx", NULL, (VOID**)&SlitSystemLocalityCount, NULL, NULL} }; =20 -/** Macro to get the value of a System Locality -*/ +/** + Macro to get the value of a System Locality +**/ #define SLIT_ELEMENT(Ptr, i, j) *(Ptr + (i * LocalityCount) + j) =20 -/** This function parses the ACPI SLIT table. +/** + This function parses the ACPI SLIT table. When trace is enabled this function parses the SLIT table and traces the ACPI table fields. =20 This function also validates System Localities for the following: - Diagonal elements have a normalized value of 10 @@ -47,11 +50,11 @@ STATIC CONST ACPI_PARSER SlitParser[] =3D { =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiSlit ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/Spcr= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrPa= rser.c index 841a27ffdfa..64340886fe5 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c @@ -1,6 +1,6 @@ -/** +/** @file SPCR table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -22,40 +22,43 @@ #include "AcpiTableParser.h" =20 // Local variables STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** This function validates the Interrupt Type. +/** + This function validates the Interrupt Type. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateInterruptType ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** This function validates the Irq. +/** + This function validates the Irq. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateIrq ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** An ACPI_PARSER array describing the ACPI SPCR Table. -*/ +/** + An ACPI_PARSER array describing the ACPI SPCR Table. +**/ STATIC CONST ACPI_PARSER SpcrParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"Interface Type", 1, 36, L"%d", NULL, NULL, NULL, NULL}, {L"Reserved", 3, 37, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}, {L"Base Address", 12, 40, NULL, DumpGas, NULL, NULL, NULL}, @@ -77,16 +80,17 @@ STATIC CONST ACPI_PARSER SpcrParser[] =3D { {L"PCI Flags", 4, 71, L"0x%x", NULL, NULL, NULL, NULL}, {L"PCI Segment", 1, 75, L"0x%x", NULL, NULL, NULL, NULL}, {L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL} }; =20 -/** This function validates the Interrupt Type. +/** + This function validates the Interrupt Type. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateInterruptType ( IN UINT8* Ptr, @@ -104,16 +108,17 @@ ValidateInterruptType ( ); } #endif } =20 -/** This function validates the Irq. +/** + This function validates the Irq. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateIrq ( IN UINT8* Ptr, @@ -130,21 +135,22 @@ ValidateIrq ( ); } #endif } =20 -/** This function parses the ACPI SPCR table. +/** + This function parses the ACPI SPCR table. When trace is enabled this function parses the SPCR table and traces the ACPI table fields. =20 This function also performs validations of the ACPI table fields. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiSpcr ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/Srat= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratPa= rser.c index 86da55935c8..fbe943d898a 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c @@ -1,6 +1,6 @@ -/** +/** @file SRAT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -23,77 +23,83 @@ // Local Variables STATIC CONST UINT8* SratRAType; STATIC CONST UINT8* SratRALength; STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 -/** This function validates the Reserved field in the SRAT table header. +/** + This function validates the Reserved field in the SRAT table header. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateSratReserved ( IN UINT8* Ptr, IN VOID* Context ); =20 -/** This function traces the APIC Proximity Domain field. +/** + This function traces the APIC Proximity Domain field. =20 @param [in] Format Format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ STATIC VOID DumpSratApicProximity ( IN CONST CHAR16* Format, IN UINT8* Ptr ); =20 -/** An ACPI_PARSER array describing the SRAT Table. -*/ +/** + An ACPI_PARSER array describing the SRAT Table. +**/ STATIC CONST ACPI_PARSER SratParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo), {L"Reserved", 4, 36, L"0x%x", NULL, NULL, ValidateSratReserved, NULL}, {L"Reserved", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the Resource Allocation - structure header. -*/ +/** + An ACPI_PARSER array describing the Resource Allocation structure header. +**/ STATIC CONST ACPI_PARSER SratResourceAllocationParser[] =3D { {L"Type", 1, 0, NULL, NULL, (VOID**)&SratRAType, NULL, NULL}, {L"Length", 1, 1, NULL, NULL, (VOID**)&SratRALength, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the GICC Affinity structure. -*/ +/** + An ACPI_PARSER array describing the GICC Affinity structure. +**/ STATIC CONST ACPI_PARSER SratGicCAffinityParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, =20 {L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL}, {L"ACPI Processor UID", 4, 6, L"0x%x", NULL, NULL, NULL, NULL}, {L"Flags", 4, 10, L"0x%x", NULL, NULL, NULL, NULL}, {L"Clock Domain", 4, 14, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the GIC ITS Affinity structure. -*/ +/** + An ACPI_PARSER array describing the GIC ITS Affinity structure. +**/ STATIC CONST ACPI_PARSER SratGicITSAffinityParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, =20 {L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL}, {L"Reserved", 2, 6, L"0x%x", NULL, NULL, NULL, NULL}, {L"ITS Id", 4, 8, L"0x%x", NULL, NULL, NULL, NULL}, }; =20 -/** An ACPI_PARSER array describing the Memory Affinity structure. -*/ +/** + An ACPI_PARSER array describing the Memory Affinity structure. +**/ STATIC CONST ACPI_PARSER SratMemAffinityParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, =20 {L"Proximity Domain", 4, 2, L"0x%x", NULL, NULL, NULL, NULL}, @@ -105,12 +111,13 @@ STATIC CONST ACPI_PARSER SratMemAffinityParser[] =3D { {L"Reserved", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}, {L"Flags", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, {L"Reserved", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the APIC/SAPIC Affinity structure. -*/ +/** + An ACPI_PARSER array describing the APIC/SAPIC Affinity structure. +**/ STATIC CONST ACPI_PARSER SratApciSapicAffinityParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, =20 {L"Proximity Domain [7:0]", 1, 2, L"0x%x", NULL, NULL, NULL, NULL}, @@ -120,13 +127,13 @@ STATIC CONST ACPI_PARSER SratApciSapicAffinityParser[= ] =3D { {L"Proximity Domain [31:8]", 3, 9, L"0x%x", DumpSratApicProximity, NULL, NULL, NULL}, {L"Clock Domain", 4, 12, L"0x%x", NULL, NULL, NULL, NULL} }; =20 -/** An ACPI_PARSER array describing the Processor Local x2APIC - Affinity structure. -*/ +/** + An ACPI_PARSER array describing the Processor Local x2APIC Affinity stru= cture. +**/ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] =3D { {L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL}, {L"Length", 1, 1, L"0x%x", NULL, NULL, NULL, NULL}, =20 {L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL}, @@ -140,11 +147,11 @@ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = =3D { /** This function validates the Reserved field in the SRAT table header. =20 @param [in] Ptr Pointer to the start of the field data. @param [in] Context Pointer to context specific information e.g. this could be a pointer to the ACPI table header. -*/ +**/ STATIC VOID EFIAPI ValidateSratReserved ( IN UINT8* Ptr, @@ -155,15 +162,16 @@ ValidateSratReserved ( IncrementErrorCount (); Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n"); } } =20 -/** This function traces the APIC Proximity Domain field. +/** + This function traces the APIC Proximity Domain field. =20 @param [in] Format Format string for tracing the data. @param [in] Ptr Pointer to the start of the buffer. -*/ +**/ STATIC VOID DumpSratApicProximity ( IN CONST CHAR16* Format, IN UINT8* Ptr @@ -171,11 +179,12 @@ DumpSratApicProximity ( { UINT32 ProximityDomain =3D Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16); Print (Format, ProximityDomain); } =20 -/** This function parses the ACPI SRAT table. +/** + This function parses the ACPI SRAT table. When trace is enabled this function parses the SRAT table and traces the ACPI table fields. =20 This function parses the following Resource Allocation Structures: - Processor Local APIC/SAPIC Affinity Structure @@ -187,11 +196,11 @@ DumpSratApicProximity ( =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiSrat ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ssdt/Ssdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ssdt/SsdtPa= rser.c index a77ccbe0606..69792140035 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ssdt/SsdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Ssdt/SsdtParser.c @@ -1,6 +1,6 @@ -/** +/** @file SSDT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -17,21 +17,22 @@ #include #include #include "AcpiParser.h" #include "AcpiTableParser.h" =20 -/** This function parses the ACPI SSDT table. +/** + This function parses the ACPI SSDT table. When trace is enabled this function parses the SSDT table and traces the ACPI table fields. For the SSDT table only the ACPI header fields are parsed and traced. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiSsdt ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/Xsdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtPa= rser.c index 0ed65d2e72c..99521cd67a7 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c @@ -1,6 +1,6 @@ -/** +/** @file XSDT table parser =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -27,29 +27,32 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; */ STATIC CONST ACPI_PARSER XsdtParser[] =3D { PARSE_ACPI_HEADER (&AcpiHdrInfo) }; =20 +/** + Get the ACPI XSDT header info. +**/ CONST ACPI_DESCRIPTION_HEADER_INFO* CONST EFIAPI GetAcpiXsdtHeaderInfo ( VOID ) { return &AcpiHdrInfo; } =20 -/** This function parses the ACPI XSDT table - and optionally traces the ACPI table fields. +/** + This function parses the ACPI XSDT table and optionally traces the ACPI = table fields. =20 This function also performs validation of the XSDT table. =20 @param [in] Trace If TRUE, trace the ACPI fields. @param [in] Ptr Pointer to the start of the buffer. @param [in] AcpiTableLength Length of the ACPI table. @param [in] AcpiTableRevision Revision of the ACPI table. -*/ +**/ VOID EFIAPI ParseAcpiXsdt ( IN BOOLEAN Trace, IN UINT8* Ptr, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.c index 7de28691be2..8479bfbc9be 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c @@ -1,6 +1,6 @@ -/** +/** @file Main file for 'acpiview' Shell command function. =20 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -47,19 +47,20 @@ ACPI_TABLE_PARSER ParserList[] =3D { {EFI_ACPI_6_2_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE, ParseAcpiSrat}, {EFI_ACPI_6_2_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, ParseAcpiSsd= t}, {EFI_ACPI_6_2_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, ParseAcpiXsdt} }; =20 -/** This function registers all the available table parsers. +/** + This function registers all the available table parsers. =20 @retval EFI_SUCCESS The parser is registered. @retval EFI_ALREADY_STARTED The parser for the ACPI Table was already registered. @retval EFI_INVALID_PARAMETER A parameter is invalid. @retval EFI_OUT_OF_RESOURCES No space to register the parser. -*/ +**/ EFI_STATUS RegisterAllParsers ( ) { EFI_STATUS Status; @@ -78,11 +79,11 @@ RegisterAllParsers ( =20 /** Return the file name of the help text file if not using HII. =20 @return The string pointer to the file name. -*/ +**/ CONST CHAR16* EFIAPI ShellCommandGetManFileNameAcpiView ( VOID ) @@ -99,11 +100,11 @@ ShellCommandGetManFileNameAcpiView ( @param SystemTable The EFI System Table pointer. =20 @retval EFI_SUCCESS The Shell command handlers were installed successfully. @retval EFI_DEVICE_ERROR Hii package failed to install. -*/ +**/ EFI_STATUS EFIAPI UefiShellAcpiViewCommandLibConstructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable @@ -150,11 +151,11 @@ UefiShellAcpiViewCommandLibConstructor ( /** Destructor for the library. free any resources. =20 @param ImageHandle The image handle of the process. @param SystemTable The EFI System Table pointer. -*/ +**/ EFI_STATUS EFIAPI UefiShellAcpiViewCommandLibDestructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.h index 59c8e21544d..f547569cf37 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h @@ -1,6 +1,6 @@ -/** +/** @file Header file for 'acpiview' Shell command functions. =20 Copyright (c) 2016 - 2017, ARM Limited. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License @@ -19,11 +19,11 @@ extern EFI_HII_HANDLE gShellAcpiViewHiiHandle; /** Function for 'acpiview' command. =20 @param[in] ImageHandle Handle to the Image (NULL if Internal). @param[in] SystemTable Pointer to the System Table (NULL if Internal). -*/ +**/ SHELL_STATUS EFIAPI ShellCommandRunAcpiView ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Fri Apr 19 14:41:01 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1528187727338795.8896151525737; Tue, 5 Jun 2018 01:35:27 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3932021155D36; Tue, 5 Jun 2018 01:35:26 -0700 (PDT) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9173D21155D2A for ; Tue, 5 Jun 2018 01:35:24 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2018 01:35:24 -0700 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2018 01:35:22 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,478,1520924400"; d="scan'208";a="54844293" From: Dandan Bi To: edk2-devel@lists.01.org Date: Tue, 5 Jun 2018 16:33:48 +0800 Message-Id: <20180605083348.81864-3-dandan.bi@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 In-Reply-To: <20180605083348.81864-1-dandan.bi@intel.com> References: <20180605083348.81864-1-dandan.bi@intel.com> Subject: [edk2] [patch 2/2] ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issues X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaben Carsey , Ruiyu Ni MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 1. Separate variable definition and initialization. 2. Make the variable naming following Edk2 rule. Naming convention of local variable: a.First character should be upper case. b.Must contain lower case characters. c.No white space characters. Cc: Sami Mujawar Cc: Evan Lloyd Cc: Sami Mujawar Cc: Evan Lloyd Cc: Jaben Carsey Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- .../UefiShellAcpiViewCommandLib/AcpiParser.c | 44 ++++++++++------ .../UefiShellAcpiViewCommandLib/AcpiParser.h | 6 +-- .../UefiShellAcpiViewCommandLib/AcpiTableParser.c | 50 +++++++++---------- .../UefiShellAcpiViewCommandLib/AcpiTableParser.h | 6 +-- .../Library/UefiShellAcpiViewCommandLib/AcpiView.c | 58 ++++++++++++++----= ---- .../Library/UefiShellAcpiViewCommandLib/AcpiView.h | 16 +++--- .../Parsers/Dbg2/Dbg2Parser.c | 5 +- .../Parsers/Gtdt/GtdtParser.c | 5 +- .../Parsers/Iort/IortParser.c | 26 +++++----- .../Parsers/Madt/MadtParser.c | 4 +- .../Parsers/Rsdp/RsdpParser.c | 10 +++- .../Parsers/Slit/SlitParser.c | 44 ++++++++-------- .../Parsers/Spcr/SpcrParser.c | 10 +++- .../Parsers/Srat/SratParser.c | 21 +++++--- .../UefiShellAcpiViewCommandLib.c | 5 +- .../UefiShellAcpiViewCommandLib.h | 6 +-- .../UefiShellAcpiViewCommandLib.inf | 3 ++ 17 files changed, 190 insertions(+), 129 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/Sh= ellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c index 088575d0144..6d3bc451acd 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c @@ -19,10 +19,19 @@ =20 STATIC UINT32 gIndent; STATIC UINT32 mTableErrorCount; STATIC UINT32 mTableWarningCount; =20 +STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; + +/** + An ACPI_PARSER array describing the ACPI header. +**/ +STATIC CONST ACPI_PARSER AcpiHeaderParser[] =3D { + PARSE_ACPI_HEADER (&AcpiHdrInfo) +}; + /** This function resets the ACPI table error counter to Zero. **/ VOID ResetErrorCount ( @@ -112,14 +121,17 @@ VerifyChecksum ( IN BOOLEAN Log, IN UINT8* Ptr, IN UINT32 Length ) { - UINTN ByteCount =3D 0; - UINT8 Checksum =3D 0; + UINTN ByteCount; + UINT8 Checksum; UINTN OriginalAttribute; =20 + ByteCount =3D 0; + Checksum =3D 0; + while (ByteCount < Length) { Checksum +=3D *(Ptr++); ByteCount++; } =20 @@ -164,15 +176,18 @@ EFIAPI DumpRaw ( IN UINT8* Ptr, IN UINT32 Length ) { - UINTN ByteCount =3D 0; + UINTN ByteCount; UINTN PartLineChars; - UINTN AsciiBufferIndex =3D 0; + UINTN AsciiBufferIndex; CHAR8 AsciiBuffer[17]; =20 + ByteCount =3D 0; + AsciiBufferIndex =3D 0; + Print (L"Address : 0x%p\n", Ptr); Print (L"Length : %d\n", Length); =20 while (ByteCount < Length) { if ((ByteCount & 0x0F) =3D=3D 0) { @@ -275,11 +290,14 @@ DumpUint64 ( ) { // Some fields are not aligned and this causes alignment faults // on ARM platforms if the compiler generates LDRD instructions. // Perform word access so that LDRD instructions are not generated. - UINT64 Val =3D *(UINT32*)(Ptr + sizeof (UINT32)); + UINT64 Val; + + Val =3D *(UINT32*)(Ptr + sizeof (UINT32)); + Val <<=3D 32; Val |=3D *(UINT32*)Ptr; =20 Print (Format, Val); } @@ -454,17 +472,20 @@ ParseAcpi ( IN CONST ACPI_PARSER* Parser, IN UINT32 ParserItems ) { UINT32 Index; - UINT32 Offset =3D 0; + UINT32 Offset; + BOOLEAN HighLight; + + Offset =3D 0; =20 // Increment the Indent gIndent +=3D Indent; =20 if (Trace && (AsciiName !=3D NULL)){ - BOOLEAN HighLight =3D GetColourHighlighting (); + HighLight =3D GetColourHighlighting (); UINTN OriginalAttribute; =20 if (HighLight) { OriginalAttribute =3D gST->ConOut->Mode->Attribute; gST->ConOut->SetAttribute ( @@ -618,15 +639,10 @@ UINT32 EFIAPI DumpAcpiHeader ( IN UINT8* Ptr ) { - ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; - ACPI_PARSER AcpiHeaderParser[] =3D { - PARSE_ACPI_HEADER (&AcpiHdrInfo) - }; - return ParseAcpi ( TRUE, 0, "ACPI Table Header", Ptr, @@ -656,14 +672,10 @@ ParseAcpiHeader ( OUT CONST UINT32** Length, OUT CONST UINT8** Revision ) { UINT32 BytesParsed; - ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; - ACPI_PARSER AcpiHeaderParser[] =3D { - PARSE_ACPI_HEADER (&AcpiHdrInfo) - }; =20 BytesParsed =3D ParseAcpi ( FALSE, 0, NULL, diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/Sh= ellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h index ecf7dae9038..cea8857bc08 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h @@ -9,12 +9,12 @@ =20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. **/ =20 -#ifndef ACPIPARSER_H_ -#define ACPIPARSER_H_ +#ifndef __ACPIPARSER_H__ +#define __ACPIPARSER_H__ =20 #define OUTPUT_FIELD_COLUMN_WIDTH 36 =20 /// The RSDP table signature is "RSD PTR " (8 bytes) /// However The signature for ACPI tables is 4 bytes. @@ -789,6 +789,6 @@ ParseAcpiXsdt ( IN UINT8* Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ); =20 -#endif // ACPIPARSER_H_ +#endif // __ACPIPARSER_H__ diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c= b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c index 7b1a02cad3e..fff5757bf58 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c @@ -43,36 +43,36 @@ EFIAPI RegisterParser ( IN UINT32 Signature, IN PARSE_ACPI_TABLE_PROC ParserProc ) { - UINT32 index; + UINT32 Index; =20 if ((ParserProc =3D=3D NULL) || (Signature =3D=3D ACPI_PARSER_SIGNATURE_= NULL)) { return EFI_INVALID_PARAMETER; } =20 // Search if a parser is already installed - for (index =3D 0; - index < (sizeof (mTableParserList) / sizeof (mTableParserList[0])); - index++) + for (Index =3D 0; + Index < (sizeof (mTableParserList) / sizeof (mTableParserList[0])); + Index++) { - if (Signature =3D=3D mTableParserList[index].Signature) { - if (mTableParserList[index].Parser !=3D NULL) { + if (Signature =3D=3D mTableParserList[Index].Signature) { + if (mTableParserList[Index].Parser !=3D NULL) { return EFI_ALREADY_STARTED; } } } =20 // Find the first free slot and register the parser - for (index =3D 0; - index < (sizeof (mTableParserList) / sizeof (mTableParserList[0])); - index++) + for (Index =3D 0; + Index < (sizeof (mTableParserList) / sizeof (mTableParserList[0])); + Index++) { - if (mTableParserList[index].Signature =3D=3D ACPI_PARSER_SIGNATURE_NUL= L) { - mTableParserList[index].Signature =3D Signature; - mTableParserList[index].Parser =3D ParserProc; + if (mTableParserList[Index].Signature =3D=3D ACPI_PARSER_SIGNATURE_NUL= L) { + mTableParserList[Index].Signature =3D Signature; + mTableParserList[Index].Parser =3D ParserProc; return EFI_SUCCESS; } } =20 // No free slot found @@ -94,23 +94,23 @@ EFI_STATUS EFIAPI DeregisterParser ( IN UINT32 Signature ) { - UINT32 index; + UINT32 Index; =20 if (Signature =3D=3D ACPI_PARSER_SIGNATURE_NULL) { return EFI_INVALID_PARAMETER; } =20 - for (index =3D 0; - index < (sizeof (mTableParserList) / sizeof (mTableParserList[0])); - index++) + for (Index =3D 0; + Index < (sizeof (mTableParserList) / sizeof (mTableParserList[0])); + Index++) { - if (Signature =3D=3D mTableParserList[index].Signature) { - mTableParserList[index].Signature =3D ACPI_PARSER_SIGNATURE_NULL; - mTableParserList[index].Parser =3D NULL; + if (Signature =3D=3D mTableParserList[Index].Signature) { + mTableParserList[Index].Signature =3D ACPI_PARSER_SIGNATURE_NULL; + mTableParserList[Index].Parser =3D NULL; return EFI_SUCCESS; } } =20 // No matching registered parser found. @@ -135,22 +135,22 @@ EFIAPI GetParser ( IN UINT32 Signature, OUT PARSE_ACPI_TABLE_PROC * ParserProc ) { - UINT32 index; + UINT32 Index; =20 if ((ParserProc =3D=3D NULL) || (Signature =3D=3D ACPI_PARSER_SIGNATURE_= NULL)) { return EFI_INVALID_PARAMETER; } =20 - for (index =3D 0; - index < (sizeof (mTableParserList) / sizeof (mTableParserList[0])); - index++) + for (Index =3D 0; + Index < (sizeof (mTableParserList) / sizeof (mTableParserList[0])); + Index++) { - if (Signature =3D=3D mTableParserList[index].Signature) { - *ParserProc =3D mTableParserList[index].Parser; + if (Signature =3D=3D mTableParserList[Index].Signature) { + *ParserProc =3D mTableParserList[Index].Parser; return EFI_SUCCESS; } } =20 // No matching registered parser found. diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h= b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h index ca33b935760..5a6c4df12f3 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h @@ -9,12 +9,12 @@ =20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. **/ =20 -#ifndef ACPITABLEPARSER_H_ -#define ACPITABLEPARSER_H_ +#ifndef __ACPITABLEPARSER_H__ +#define __ACPITABLEPARSER_H__ =20 /** The maximum number of ACPI table parsers. */ #define MAX_ACPI_TABLE_PARSERS 16 @@ -128,6 +128,6 @@ EFIAPI GetParser ( IN UINT32 Signature, OUT PARSE_ACPI_TABLE_PROC * ParserProc ); =20 -#endif // ACPITABLEPARSER_H_ +#endif // __ACPITABLEPARSER_H__ diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index f5602e94291..47ce93f104b 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -120,12 +120,15 @@ DumpAcpiTableToFile ( IN CONST UINTN Length ) { EFI_STATUS Status; CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; - SHELL_FILE_HANDLE DumpFileHandle =3D NULL; - UINTN TransferBytes =3D Length; + SHELL_FILE_HANDLE DumpFileHandle; + UINTN TransferBytes; + + DumpFileHandle =3D NULL; + TransferBytes =3D Length; =20 UnicodeSPrint ( FileNameBuffer, sizeof (FileNameBuffer), L".\\%s%04d.bin", @@ -184,24 +187,29 @@ ProcessTableReportOptions ( IN CONST UINT8* TablePtr, IN CONST UINT32 Length ) { UINTN OriginalAttribute; - UINT8* SignaturePtr =3D (UINT8*)(UINTN)&Signature; - BOOLEAN Log =3D FALSE; - BOOLEAN HighLight =3D GetColourHighlighting (); + UINT8* SignaturePtr; + BOOLEAN Log; + BOOLEAN HighLight; + + SignaturePtr =3D (UINT8*)(UINTN)&Signature; + Log =3D FALSE; + HighLight =3D GetColourHighlighting (); + switch (GetReportOption ()) { - case EREPORT_ALL: + case ReportAll: Log =3D TRUE; break; - case EREPORT_SELECTED: + case ReportSelected: if (Signature =3D=3D GetSelectedAcpiTable ()) { Log =3D TRUE; mSelectedAcpiTableFound =3D TRUE; } break; - case EREPORT_TABLE_LIST: + case ReportTableList: if (mTableCount =3D=3D 0) { if (HighLight) { OriginalAttribute =3D gST->ConOut->Mode->Attribute; gST->ConOut->SetAttribute ( gST->ConOut, @@ -221,17 +229,17 @@ ProcessTableReportOptions ( SignaturePtr[1], SignaturePtr[2], SignaturePtr[3] ); break; - case EREPORT_DUMP_BIN_FILE: + case ReportDumpBinFile: if (Signature =3D=3D GetSelectedAcpiTable ()) { mSelectedAcpiTableFound =3D TRUE; DumpAcpiTableToFile (TablePtr, Length); } break; - case EREPORT_MAX: + case ReportMax: // We should never be here. // This case is only present to prevent compiler warning. break; } // switch =20 @@ -271,13 +279,15 @@ STATIC UINT32 ConvertStrToAcpiSignature ( IN CONST CHAR16* Str ) { - UINT8 Index =3D 0; + UINT8 Index; CHAR8 Ptr[4]; =20 + Index =3D 0; + // Convert to Upper case and convert to ASCII while ((Index < 4) && (Str[Index] !=3D 0)) { if (Str[Index] >=3D L'a' && Str[Index] <=3D L'z') { Ptr[Index] =3D (CHAR8)(Str[Index] - (L'a' - L'A')); } else { @@ -369,16 +379,16 @@ AcpiView ( ); return EFI_NOT_FOUND; } =20 ReportOption =3D GetReportOption (); - if (EREPORT_TABLE_LIST !=3D ReportOption) { - if (((EREPORT_SELECTED =3D=3D ReportOption) || - (EREPORT_DUMP_BIN_FILE =3D=3D ReportOption)) && + if (ReportTableList !=3D ReportOption) { + if (((ReportSelected =3D=3D ReportOption) || + (ReportDumpBinFile =3D=3D ReportOption)) && (!mSelectedAcpiTableFound)) { Print (L"\nRequested ACPI Table not found.\n"); - } else if (EREPORT_DUMP_BIN_FILE !=3D ReportOption) { + } else if (ReportDumpBinFile !=3D ReportOption) { OriginalAttribute =3D gST->ConOut->Mode->Attribute; =20 Print (L"\nTable Statistics:\n"); =20 if (GetColourHighlighting ()) { @@ -424,27 +434,31 @@ ShellCommandRunAcpiView ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE* SystemTable ) { EFI_STATUS Status; - SHELL_STATUS ShellStatus =3D SHELL_SUCCESS; - LIST_ENTRY* Package =3D NULL; + SHELL_STATUS ShellStatus; + LIST_ENTRY* Package; CHAR16* ProblemParam; CONST CHAR16* Temp; CHAR8 ColourOption[8]; - SHELL_FILE_HANDLE TmpDumpFileHandle =3D NULL; + SHELL_FILE_HANDLE TmpDumpFileHandle; =20 // Set Defaults - mReportType =3D EREPORT_ALL; + mReportType =3D ReportAll; mTableCount =3D 0; mBinTableCount =3D 0; mSelectedAcpiTable =3D 0; mSelectedAcpiTableName =3D NULL; mSelectedAcpiTableFound =3D FALSE; mVerbose =3D TRUE; mConsistencyCheck =3D TRUE; =20 + ShellStatus =3D SHELL_SUCCESS; + Package =3D NULL; + TmpDumpFileHandle =3D NULL; + // Reset The error/warning counters ResetErrorCount (); ResetWarningCount (); =20 Status =3D ShellCommandLineParse (ParamList, &Package, &ProblemParam, TR= UE); @@ -545,23 +559,23 @@ ShellCommandRunAcpiView ( SetColourHighlighting (FALSE); } } =20 if (ShellCommandLineGetFlag (Package, L"-l")) { - mReportType =3D EREPORT_TABLE_LIST; + mReportType =3D ReportTableList; } else { mSelectedAcpiTableName =3D ShellCommandLineGetValue (Package, L"-s= "); if (mSelectedAcpiTableName !=3D NULL) { mSelectedAcpiTable =3D (UINT32)ConvertStrToAcpiSignature ( mSelectedAcpiTableName ); - mReportType =3D EREPORT_SELECTED; + mReportType =3D ReportSelected; =20 if (ShellCommandLineGetFlag (Package, L"-d")) { // Create a temporary file to check if the media is writable. CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN]; - mReportType =3D EREPORT_DUMP_BIN_FILE; + mReportType =3D ReportDumpBinFile; =20 UnicodeSPrint ( FileNameBuffer, sizeof (FileNameBuffer), L".\\%s%04d.tmp", diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h index b035395a721..4e7ac93ca03 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h @@ -9,12 +9,12 @@ =20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. **/ =20 -#ifndef ACPIVIEW_H_ -#define ACPIVIEW_H_ +#ifndef __ACPIVIEW_H__ +#define __ACPIVIEW_H__ =20 /** A macro to define the max file name length **/ #define MAX_FILE_NAME_LEN 128 @@ -31,15 +31,15 @@ =20 /** The EREPORT_OPTION enum describes ACPI table Reporting options. **/ typedef enum ReportOption { - EREPORT_ALL, ///< Report All tables. - EREPORT_SELECTED, ///< Report Selected table. - EREPORT_TABLE_LIST, ///< Report List of tables. - EREPORT_DUMP_BIN_FILE, ///< Dump selected table to a file. - EREPORT_MAX + ReportAll, ///< Report All tables. + ReportSelected, ///< Report Selected table. + ReportTableList, ///< Report List of tables. + ReportDumpBinFile, ///< Dump selected table to a file. + ReportMax, } EREPORT_OPTION; =20 /** This function resets the ACPI table error counter to Zero. **/ @@ -111,6 +111,6 @@ ProcessTableReportOptions ( IN CONST UINT32 Signature, IN CONST UINT8* TablePtr, IN CONST UINT32 Length ); =20 -#endif // ACPIVIEW_H_ +#endif // __ACPIVIEW_H__ diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Pa= rser.c index 7f66bce074e..bc8b7b00e38 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dbg2/Dbg2Parser.c @@ -110,11 +110,14 @@ EFIAPI ValidateNameSpaceStrLen ( IN UINT8* Ptr, IN VOID* Context ) { - UINT16 NameSpaceStrLen =3D *(UINT16*)Ptr; + UINT16 NameSpaceStrLen; + + NameSpaceStrLen =3D *(UINT16*)Ptr; + if (NameSpaceStrLen < 2) { IncrementErrorCount (); Print ( L"\nERROR: NamespaceString Length =3D %d. If no Namespace device exi= sts,\n" " then NamespaceString[] must contain a period '.'", diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/Gtdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtPa= rser.c index 30cf3e14f7e..3a3cee948ad 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Gtdt/GtdtParser.c @@ -136,11 +136,14 @@ EFIAPI ValidateGtBlockTimerCount ( IN UINT8* Ptr, IN VOID* Context ) { - UINT32 BlockTimerCount =3D *(UINT32*)Ptr; + UINT32 BlockTimerCount; + + BlockTimerCount =3D *(UINT32*)Ptr; + if (BlockTimerCount > 8) { IncrementErrorCount (); Print ( L"\nERROR: Timer Count =3D %d. Max Timer Count is 8.", BlockTimerCount diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Iort= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortPa= rser.c index 704dfc407cc..fb0abe3c43b 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c @@ -25,17 +25,17 @@ STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo; =20 /** The EIORT_NODE enum describes the IORT Node types. **/ typedef enum IortNode { - EIORT_NODE_ITS_GROUP, ///< ITS Group node - EIORT_NODE_NAMED_COMPONENT, ///< Named Component node - EIORT_NODE_ROOT_COMPLEX, ///< Root Complex node - EIORT_NODE_SMMUV1_V2, ///< SMMU v1/v2 node - EIORT_NODE_SMMUV3, ///< SMMU v3 node - EIORT_NODE_PMCG, ///< PMC group node - EIORT_NODE_MAX + Iort_Node_ITS_Group, ///< ITS Group node + Iort_Node_Named_Component, ///< Named Component node + Iort_Node_Root_Complex, ///< Root Complex node + Iort_Node_SMMUV1_V2, ///< SMMU v1/v2 node + Iort_Node_SMMUV3, ///< SMMU v3 node + Iort_Node_PMCG, ///< PMC group node + Iort_Node_Max } EIORT_NODE; =20 // Local Variables STATIC CONST UINT32* IortNodeCount; STATIC CONST UINT32* IortNodeOffset; @@ -663,49 +663,49 @@ ParseAcpiIort ( =20 PrintFieldName (2, L"* Node Offset *"); Print (L"0x%x\n", Offset); =20 switch (*IortNodeType) { - case EIORT_NODE_ITS_GROUP: + case Iort_Node_ITS_Group: DumpIortNodeIts ( NodePtr, *IortNodeLength ); break; - case EIORT_NODE_NAMED_COMPONENT: + case Iort_Node_Named_Component: DumpIortNodeNamedComponent ( NodePtr, *IortNodeLength, *IortIdMappingCount, *IortIdMappingOffset ); break; - case EIORT_NODE_ROOT_COMPLEX: + case Iort_Node_Root_Complex: DumpIortNodeRootComplex ( NodePtr, *IortNodeLength, *IortIdMappingCount, *IortIdMappingOffset ); break; - case EIORT_NODE_SMMUV1_V2: + case Iort_Node_SMMUV1_V2: DumpIortNodeSmmuV1V2 ( NodePtr, *IortNodeLength, *IortIdMappingCount, *IortIdMappingOffset ); break; - case EIORT_NODE_SMMUV3: + case Iort_Node_SMMUV3: DumpIortNodeSmmuV3 ( NodePtr, *IortNodeLength, *IortIdMappingCount, *IortIdMappingOffset ); break; - case EIORT_NODE_PMCG: + case Iort_Node_PMCG: DumpIortNodePmcg ( NodePtr, *IortNodeLength, *IortIdMappingCount, *IortIdMappingOffset diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/Madt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPa= rser.c index 3ac27086a6b..a704b0c6314 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c @@ -195,11 +195,13 @@ ParseAcpiMadt ( IN UINT8 AcpiTableRevision ) { UINT32 Offset; UINT8* InterruptContollerPtr; - UINT32 GICDCount =3D 0; + UINT32 GICDCount; + + GICDCount =3D 0; =20 if (!Trace) { return; } =20 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/Rsdp= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpPa= rser.c index c33bb1e9234..164cd462022 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c @@ -86,11 +86,14 @@ ValidateRsdtAddress ( // Reference: Server Base Boot Requirements System Software on ARM Platf= orms // Section: 4.2.1.1 RSDP // Root System Description Pointer (RSDP), ACPI ? 5.2.5. // - Within the RSDP, the RsdtAddress field must be null (zero) and the // XsdtAddresss MUST be a valid, non-null, 64-bit value. - UINT32 RsdtAddr =3D *(UINT32*)Ptr; + UINT32 RsdtAddr; + + RsdtAddr =3D *(UINT32*)Ptr; + if (RsdtAddr !=3D 0) { IncrementErrorCount (); Print ( L"\nERROR: Rsdt Address =3D 0x%p. This must be NULL on ARM Platforms= .", RsdtAddr @@ -118,11 +121,14 @@ ValidateXsdtAddress ( // Reference: Server Base Boot Requirements System Software on ARM Platf= orms // Section: 4.2.1.1 RSDP // Root System Description Pointer (RSDP), ACPI ? 5.2.5. // - Within the RSDP, the RsdtAddress field must be null (zero) and the // XsdtAddresss MUST be a valid, non-null, 64-bit value. - UINT64 XsdtAddr =3D *(UINT64*)Ptr; + UINT64 XsdtAddr; + + XsdtAddr =3D *(UINT64*)Ptr; + if (XsdtAddr =3D=3D 0) { IncrementErrorCount (); Print ( L"\nERROR: Xsdt Address =3D 0x%p. This must not be NULL on ARM Platf= orms.", XsdtAddr diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/Slit= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitPa= rser.c index a028ae541ca..c38666d2b7f 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Slit/SlitParser.c @@ -61,12 +61,12 @@ ParseAcpiSlit ( IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision ) { UINT32 Offset; - UINT64 i; - UINT64 j; + UINT64 Count; + UINT64 Index; UINT64 LocalityCount; UINT8* LocalityPtr; CHAR16 Buffer[80]; // Used for AsciiName param of ParseAcpi =20 if (!Trace) { @@ -96,50 +96,50 @@ ParseAcpiSlit ( LocalityCount ); PrintFieldName (0, Buffer); Print (L"\n"); Print (L" "); - for (j =3D 0; j < LocalityCount; j++) { - Print (L" (%3d) ", j); + for (Index =3D 0; Index < LocalityCount; Index++) { + Print (L" (%3d) ", Index); } Print (L"\n"); - for (i =3D 0; i < LocalityCount; i++) { - Print (L" (%3d) ", i); - for (j =3D 0; j < LocalityCount; j++) { - Print (L" %3d ", SLIT_ELEMENT (LocalityPtr, i, j)); + for (Count =3D 0; Count< LocalityCount; Count++) { + Print (L" (%3d) ", Count); + for (Index =3D 0; Index < LocalityCount; Index++) { + Print (L" %3d ", SLIT_ELEMENT (LocalityPtr, Count, Index)); } Print (L"\n"); } } =20 // Validate - for (i =3D 0; i < LocalityCount; i++) { - for (j =3D 0; j < LocalityCount; j++) { + for (Count =3D 0; Count < LocalityCount; Count++) { + for (Index =3D 0; Index < LocalityCount; Index++) { // Element[x][x] must be equal to 10 - if ((i =3D=3D j) && (SLIT_ELEMENT (LocalityPtr, i, j) !=3D 10)) { + if ((Count =3D=3D Index) && (SLIT_ELEMENT (LocalityPtr, Count,Index)= !=3D 10)) { IncrementErrorCount (); Print ( L"ERROR: Diagonal Element[0x%lx][0x%lx] (%3d)." " Normalized Value is not 10\n", - i, - j, - SLIT_ELEMENT (LocalityPtr, i, j) + Count, + Index, + SLIT_ELEMENT (LocalityPtr, Count, Index) ); } // Element[i][j] must be equal to Element[j][i] - if (SLIT_ELEMENT (LocalityPtr, i, j) !=3D - SLIT_ELEMENT (LocalityPtr, j, i)) { + if (SLIT_ELEMENT (LocalityPtr, Count, Index) !=3D + SLIT_ELEMENT (LocalityPtr, Index, Count)) { IncrementErrorCount (); Print ( L"ERROR: Relative distances for Element[0x%lx][0x%lx] (%3d) and = \n" "Element[0x%lx][0x%lx] (%3d) do not match.\n", - i, - j, - SLIT_ELEMENT (LocalityPtr, i, j), - j, - i, - SLIT_ELEMENT (LocalityPtr, j, i) + Count, + Index, + SLIT_ELEMENT (LocalityPtr, Count, Index), + Index, + Count, + SLIT_ELEMENT (LocalityPtr, Index, Count) ); } } } } diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/Spcr= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrPa= rser.c index 64340886fe5..815ba9a9db0 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Spcr/SpcrParser.c @@ -96,11 +96,14 @@ ValidateInterruptType ( IN UINT8* Ptr, IN VOID* Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - UINT8 InterruptType =3D *Ptr; + UINT8 InterruptType; + + InterruptType =3D *Ptr; + if (InterruptType !=3D EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC)= { IncrementErrorCount (); Print ( L"\nERROR: InterruptType =3D %d. This must be 8 on ARM Platforms", @@ -124,11 +127,14 @@ ValidateIrq ( IN UINT8* Ptr, IN VOID* Context ) { #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) - UINT8 Irq =3D *Ptr; + UINT8 Irq; + + Irq =3D *Ptr; + if (Irq !=3D 0) { IncrementErrorCount (); Print ( L"\nERROR: Irq =3D %d. This must be zero on ARM Platforms\n", Irq diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/Srat= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratPa= rser.c index fbe943d898a..043277aabf8 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c @@ -175,11 +175,14 @@ VOID DumpSratApicProximity ( IN CONST CHAR16* Format, IN UINT8* Ptr ) { - UINT32 ProximityDomain =3D Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16); + UINT32 ProximityDomain; + + ProximityDomain =3D Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16); + Print (Format, ProximityDomain); } =20 /** This function parses the ACPI SRAT table. @@ -208,17 +211,23 @@ ParseAcpiSrat ( IN UINT8 AcpiTableRevision ) { UINT32 Offset; UINT8* ResourcePtr; - UINT32 GicCAffinityIndex =3D 0; - UINT32 GicITSAffinityIndex =3D 0; - UINT32 MemoryAffinityIndex =3D 0; - UINT32 ApicSapicAffinityIndex =3D 0; - UINT32 X2ApicAffinityIndex =3D 0; + UINT32 GicCAffinityIndex; + UINT32 GicITSAffinityIndex; + UINT32 MemoryAffinityIndex; + UINT32 ApicSapicAffinityIndex; + UINT32 X2ApicAffinityIndex; CHAR8 Buffer[80]; // Used for AsciiName param of ParseAcpi =20 + GicCAffinityIndex =3D 0; + GicITSAffinityIndex =3D 0; + MemoryAffinityIndex =3D 0; + ApicSapicAffinityIndex =3D 0; + X2ApicAffinityIndex =3D 0; + if (!Trace) { return; } =20 Offset =3D ParseAcpi ( diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.c index 8479bfbc9be..c2f40009eeb 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.c @@ -62,11 +62,14 @@ ACPI_TABLE_PARSER ParserList[] =3D { EFI_STATUS RegisterAllParsers ( ) { EFI_STATUS Status; - UINTN Count =3D sizeof (ParserList) / sizeof (ParserList[0]); + UINTN Count; + + Count =3D sizeof (ParserList) / sizeof (ParserList[0]); + while (Count-- !=3D 0) { Status =3D RegisterParser ( ParserList[Count].Signature, ParserList[Count].Parser ); diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiVi= ewCommandLib.h index f547569cf37..4ea958b80e7 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.h @@ -9,12 +9,12 @@ =20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. **/ =20 -#ifndef UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_ -#define UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_ +#ifndef __UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H__ +#define __UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H__ =20 extern EFI_HII_HANDLE gShellAcpiViewHiiHandle; =20 /** Function for 'acpiview' command. @@ -27,6 +27,6 @@ EFIAPI ShellCommandRunAcpiView ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ); =20 -#endif // UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H_ +#endif // __UEFI_SHELL_ACPIVIEW_COMMAND_LIB_H__ diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.inf b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpi= ViewCommandLib.inf index dbdb7e301b4..6df8c08b855 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.inf +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.inf @@ -25,10 +25,13 @@ =20 [Sources.common] UefiShellAcpiViewCommandLib.uni UefiShellAcpiViewCommandLib.c UefiShellAcpiViewCommandLib.h + AcpiParser.h + AcpiTableParser.h + AcpiView.h AcpiParser.c AcpiTableParser.c AcpiView.c Parsers/Bgrt/BgrtParser.c Parsers/Dbg2/Dbg2Parser.c --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel