summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorKrzysztof Koch <krzysztof.koch@arm.com>2020-01-30 19:42:55 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-02-19 06:01:39 +0000
commit0b9026a823e01078681a3a9153f17c78afb042dd (patch)
tree6579b423eef4f0678b0861d67f92a546c6db07a4 /ShellPkg
parentc73fce3d1280423212ed9c43bba17ef90363c354 (diff)
downloadedk2-0b9026a823e01078681a3a9153f17c78afb042dd.tar.gz
edk2-0b9026a823e01078681a3a9153f17c78afb042dd.tar.bz2
edk2-0b9026a823e01078681a3a9153f17c78afb042dd.zip
ShellPkg: acpiview: Remove duplicate ACPI structure size definitions
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>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c8
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h22
2 files changed, 5 insertions, 25 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
index 84c5f0468d..3f12a33050 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.c
@@ -1,7 +1,7 @@
/** @file
ACPI parser
- Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -673,7 +673,7 @@ DumpGas (
IN UINT8* Ptr
)
{
- DumpGasStruct (Ptr, 2, GAS_LENGTH);
+ DumpGasStruct (Ptr, 2, sizeof (EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE));
}
/**
@@ -694,7 +694,7 @@ DumpAcpiHeader (
0,
"ACPI Table Header",
Ptr,
- ACPI_DESCRIPTION_HEADER_LENGTH,
+ sizeof (EFI_ACPI_DESCRIPTION_HEADER),
PARSER_PARAMS (AcpiHeaderParser)
);
}
@@ -728,7 +728,7 @@ ParseAcpiHeader (
0,
NULL,
Ptr,
- ACPI_DESCRIPTION_HEADER_LENGTH,
+ sizeof (EFI_ACPI_DESCRIPTION_HEADER),
PARSER_PARAMS (AcpiHeaderParser)
);
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
index 6deee3542e..f81ccac7e1 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiParser.h
@@ -1,7 +1,7 @@
/** @file
Header file for ACPI parser
- Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -397,26 +397,6 @@ ParseAcpi (
(VOID**)&(Info)->CreatorRevision, NULL, NULL }
/**
- Length of the ACPI GAS structure.
-
- 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
-
-/**
- Length of the ACPI Header structure.
-
- 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
-
-/**
This function indents and traces the GAS structure as described by the GasParser.
@param [in] Ptr Pointer to the start of the buffer.