]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg: acpiview: XSDT: Remove redundant ParseAcpi() call
authorKrzysztof Koch <krzysztof.koch@arm.com>
Mon, 22 Jul 2019 22:50:22 +0000 (15:50 -0700)
committerJaben Carsey <jaben.carsey@intel.com>
Wed, 31 Jul 2019 16:52:47 +0000 (09:52 -0700)
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>
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Xsdt/XsdtParser.c

index 4196168bff47d70c67f79f3fc1f4cdee302d460e..e39061f8e2612f2cce4aebf51a511b63b703662b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   XSDT table parser\r
 \r
-  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.\r
+  Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
   @par Reference(s):\r
@@ -60,22 +60,12 @@ ParseAcpiXsdt (
   UINTN         EntryIndex;\r
   CHAR16        Buffer[32];\r
 \r
-  // Parse the ACPI header to get the length\r
-  ParseAcpi (\r
-    FALSE,\r
-    0,\r
-    "XSDT",\r
-    Ptr,\r
-    ACPI_DESCRIPTION_HEADER_LENGTH,\r
-    PARSER_PARAMS (XsdtParser)\r
-    );\r
-\r
   Offset = ParseAcpi (\r
              Trace,\r
              0,\r
              "XSDT",\r
              Ptr,\r
-             *AcpiHdrInfo.Length,\r
+             AcpiTableLength,\r
              PARSER_PARAMS (XsdtParser)\r
              );\r
 \r
@@ -84,7 +74,7 @@ ParseAcpiXsdt (
   if (Trace) {\r
     EntryIndex = 0;\r
     TablePointer = (UINT64*)(Ptr + TableOffset);\r
-    while (Offset < (*AcpiHdrInfo.Length)) {\r
+    while (Offset < AcpiTableLength) {\r
       CONST UINT32* Signature;\r
       CONST UINT32* Length;\r
       CONST UINT8*  Revision;\r
@@ -140,7 +130,7 @@ ParseAcpiXsdt (
   // Process the tables\r
   Offset = TableOffset;\r
   TablePointer = (UINT64*)(Ptr + TableOffset);\r
-  while (Offset < (*AcpiHdrInfo.Length)) {\r
+  while (Offset < AcpiTableLength) {\r
     if ((UINT64*)(UINTN)(*TablePointer) != NULL) {\r
       ProcessAcpiTable ((UINT8*)(UINTN)(*TablePointer));\r
     }\r