summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorKrzysztof Koch <krzysztof.koch@arm.com>2019-07-22 15:50:22 -0700
committerJaben Carsey <jaben.carsey@intel.com>2019-07-31 09:52:47 -0700
commiteefa8f8bf29a4547b9612159cdb6cf864efc1bb4 (patch)
tree1e1354759ef3a258e3109e2f917432fdd192cf8b /ShellPkg
parent58cc0ffe68e249ffcc73ee3d8e2120be27793f28 (diff)
downloadedk2-eefa8f8bf29a4547b9612159cdb6cf864efc1bb4.tar.gz
edk2-eefa8f8bf29a4547b9612159cdb6cf864efc1bb4.tar.bz2
edk2-eefa8f8bf29a4547b9612159cdb6cf864efc1bb4.zip
ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call
Remove a call to ParseAcpi() responsible for getting the XSDT table length. This call is not needed because the ACPI table buffer length is provided as an input argument to the ParseAcpiXsdt() function. Modify remaining code to use the AcpiTableLength argument of the ParseAcpiXsdt() function instead of a global static variable. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
index 4196168bff..e39061f8e2 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c
@@ -1,7 +1,7 @@
/** @file
XSDT table parser
- Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
+ Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Reference(s):
@@ -60,22 +60,12 @@ ParseAcpiXsdt (
UINTN EntryIndex;
CHAR16 Buffer[32];
- // Parse the ACPI header to get the length
- ParseAcpi (
- FALSE,
- 0,
- "XSDT",
- Ptr,
- ACPI_DESCRIPTION_HEADER_LENGTH,
- PARSER_PARAMS (XsdtParser)
- );
-
Offset = ParseAcpi (
Trace,
0,
"XSDT",
Ptr,
- *AcpiHdrInfo.Length,
+ AcpiTableLength,
PARSER_PARAMS (XsdtParser)
);
@@ -84,7 +74,7 @@ ParseAcpiXsdt (
if (Trace) {
EntryIndex = 0;
TablePointer = (UINT64*)(Ptr + TableOffset);
- while (Offset < (*AcpiHdrInfo.Length)) {
+ while (Offset < AcpiTableLength) {
CONST UINT32* Signature;
CONST UINT32* Length;
CONST UINT8* Revision;
@@ -140,7 +130,7 @@ ParseAcpiXsdt (
// Process the tables
Offset = TableOffset;
TablePointer = (UINT64*)(Ptr + TableOffset);
- while (Offset < (*AcpiHdrInfo.Length)) {
+ while (Offset < AcpiTableLength) {
if ((UINT64*)(UINTN)(*TablePointer) != NULL) {
ProcessAcpiTable ((UINT8*)(UINTN)(*TablePointer));
}