]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: acpiview: Remove duplicate ACPI structure size definitions
authorKrzysztof Koch <krzysztof.koch@arm.com>
Thu, 30 Jan 2020 11:42:55 +0000 (19:42 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 Feb 2020 06:01:39 +0000 (06:01 +0000)
Remove duplicate Generic Address Structure (GAS) and ACPI table header
size definitions. Replace any dependencies with the definitions from
Acpi63.h.

AcpiParser.h redefines the size of Generic Address Structure (GAS) and
the ACPI table header. The motivation is to 'minimise any reference to
the EDK2 ACPI headers in an attempt to provide cross checking'. While
the redefined values are unlikely to change, redefinition causes
unnecessary maintenance overhead for acpiview.

In addition to this, EDK2 ACPI headers are referenced throughout the
entire project, so the assumption should be that the definitions in
these header files are correct.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h

index 84c5f0468da55477acc96dfd0f949a5908d0f7a5..3f12a33050a4e4ab3be2187c90ef8dcf0882283d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ACPI parser\r
 \r
-  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.\r
+  Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
 \r
@@ -673,7 +673,7 @@ DumpGas (
   IN UINT8*        Ptr\r
   )\r
 {\r
-  DumpGasStruct (Ptr, 2, GAS_LENGTH);\r
+  DumpGasStruct (Ptr, 2, sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE));\r
 }\r
 \r
 /**\r
@@ -694,7 +694,7 @@ DumpAcpiHeader (
            0,\r
            "ACPI Table Header",\r
            Ptr,\r
-           ACPI_DESCRIPTION_HEADER_LENGTH,\r
+           sizeof (EFI_ACPI_DESCRIPTION_HEADER),\r
            PARSER_PARAMS (AcpiHeaderParser)\r
            );\r
 }\r
@@ -728,7 +728,7 @@ ParseAcpiHeader (
                   0,\r
                   NULL,\r
                   Ptr,\r
-                  ACPI_DESCRIPTION_HEADER_LENGTH,\r
+                  sizeof (EFI_ACPI_DESCRIPTION_HEADER),\r
                   PARSER_PARAMS (AcpiHeaderParser)\r
                   );\r
 \r
index 6deee3542e09bc18b03fdd18dece5b6f9725839c..f81ccac7e118378aa185db4b625e5bcd75f78347 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Header file for ACPI parser\r
 \r
-  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.\r
+  Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
 \r
@@ -396,26 +396,6 @@ ParseAcpi (
   { L"Creator Revision", 4, 32, L"0x%X", NULL,    \\r
     (VOID**)&(Info)->CreatorRevision, NULL, NULL }\r
 \r
-/**\r
-  Length of the ACPI GAS structure.\r
-\r
-  NOTE: This might normally be defined as\r
-        sizeof (EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE).\r
-        However, we deliberately minimise any reference to the EDK2 ACPI\r
-        headers in an attempt to provide cross checking.\r
-**/\r
-#define GAS_LENGTH                     12\r
-\r
-/**\r
-  Length of the ACPI Header structure.\r
-\r
-  NOTE: This might normally be defined as\r
-        sizeof (EFI_ACPI_DESCRIPTION_HEADER).\r
-        However, we deliberately minimise any reference to the EDK2 ACPI\r
-        headers in an attempt to provide cross checking.\r
-**/\r
-#define ACPI_DESCRIPTION_HEADER_LENGTH  36\r
-\r
 /**\r
   This function indents and traces the GAS structure as described by the GasParser.\r
 \r