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>
This commit is contained in:
Krzysztof Koch 2019-07-22 15:50:22 -07:00 committed by Jaben Carsey
parent 58cc0ffe68
commit eefa8f8bf2
1 changed files with 4 additions and 14 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
XSDT table parser 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 SPDX-License-Identifier: BSD-2-Clause-Patent
@par Reference(s): @par Reference(s):
@ -60,22 +60,12 @@ ParseAcpiXsdt (
UINTN EntryIndex; UINTN EntryIndex;
CHAR16 Buffer[32]; 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 ( Offset = ParseAcpi (
Trace, Trace,
0, 0,
"XSDT", "XSDT",
Ptr, Ptr,
*AcpiHdrInfo.Length, AcpiTableLength,
PARSER_PARAMS (XsdtParser) PARSER_PARAMS (XsdtParser)
); );
@ -84,7 +74,7 @@ ParseAcpiXsdt (
if (Trace) { if (Trace) {
EntryIndex = 0; EntryIndex = 0;
TablePointer = (UINT64*)(Ptr + TableOffset); TablePointer = (UINT64*)(Ptr + TableOffset);
while (Offset < (*AcpiHdrInfo.Length)) { while (Offset < AcpiTableLength) {
CONST UINT32* Signature; CONST UINT32* Signature;
CONST UINT32* Length; CONST UINT32* Length;
CONST UINT8* Revision; CONST UINT8* Revision;
@ -140,7 +130,7 @@ ParseAcpiXsdt (
// Process the tables // Process the tables
Offset = TableOffset; Offset = TableOffset;
TablePointer = (UINT64*)(Ptr + TableOffset); TablePointer = (UINT64*)(Ptr + TableOffset);
while (Offset < (*AcpiHdrInfo.Length)) { while (Offset < AcpiTableLength) {
if ((UINT64*)(UINTN)(*TablePointer) != NULL) { if ((UINT64*)(UINTN)(*TablePointer) != NULL) {
ProcessAcpiTable ((UINT8*)(UINTN)(*TablePointer)); ProcessAcpiTable ((UINT8*)(UINTN)(*TablePointer));
} }