]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
ShellPkg/UefiShellDebug1CommandsLib
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / Dmem.c
index 5491f6de578e2191626a596b864b72449543df83..e6aec2e37ccf783ae335874e9de67e73d781d1ab 100644 (file)
@@ -1,16 +1,10 @@
 /** @file\r
   Main file for Dmem shell Debug1 function.\r
 \r
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>\r
-  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>  \r
-  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>  \r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
+  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -19,7 +13,6 @@
 #include <Guid/Acpi.h>\r
 #include <Guid/Mps.h>\r
 #include <Guid/SmBios.h>\r
-#include <Guid/SalSystemTable.h>\r
 \r
 /**\r
   Make a printable character.\r
@@ -31,7 +24,6 @@
   @return A printable character representing Char.\r
 **/\r
 CHAR16\r
-EFIAPI\r
 MakePrintable(\r
   IN CONST CHAR16 Char\r
   )\r
@@ -49,7 +41,6 @@ MakePrintable(
   @param[in] Size       The length of memory to display.\r
 **/\r
 SHELL_STATUS\r
-EFIAPI\r
 DisplayMmioMemory(\r
   IN CONST VOID   *Address,\r
   IN CONST UINTN  Size\r
@@ -64,7 +55,7 @@ DisplayMmioMemory(
 \r
   Status = gBS->LocateProtocol(&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRbIo);\r
   if (EFI_ERROR(Status)) {\r
-    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"dmem");  \r
+    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_NF), gShellDebug1HiiHandle, L"dmem");\r
     return (SHELL_NOT_FOUND);\r
   }\r
   Buffer = AllocateZeroPool(Size);\r
@@ -74,7 +65,7 @@ DisplayMmioMemory(
 \r
   Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer);\r
   if (EFI_ERROR(Status)) {\r
-    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem");  \r
+    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, L"dmem");\r
     ShellStatus = SHELL_NOT_FOUND;\r
   } else {\r
     ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);\r
@@ -137,7 +128,7 @@ ShellCommandRunDmem (
   Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);\r
   if (EFI_ERROR(Status)) {\r
     if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam);  \r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, L"dmem", ProblemParam);\r
       FreePool(ProblemParam);\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else {\r
@@ -145,24 +136,24 @@ ShellCommandRunDmem (
     }\r
   } else {\r
     if (ShellCommandLineGetCount(Package) > 3) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmem");  \r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle, L"dmem");\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else {\r
       Temp1 = ShellCommandLineGetRawValue(Package, 1);\r
       if (Temp1 == NULL) {\r
         Address = gST;\r
-        Size = 512;\r
+        Size    = sizeof (*gST);\r
       } else {\r
         if (!ShellIsHexOrDecimalNumber(Temp1, TRUE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, (UINT64*)&Address, TRUE, FALSE))) {\r
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);  \r
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);\r
           ShellStatus = SHELL_INVALID_PARAMETER;\r
-        } \r
+        }\r
         Temp1 = ShellCommandLineGetRawValue(Package, 2);\r
         if (Temp1 == NULL) {\r
           Size = 512;\r
         } else {\r
           if (!ShellIsHexOrDecimalNumber(Temp1, FALSE, FALSE) || EFI_ERROR(ShellConvertStringToUint64(Temp1, &Size, TRUE, FALSE))) {\r
-            ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);  \r
+            ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);\r
             ShellStatus = SHELL_INVALID_PARAMETER;\r
           }\r
         }\r
@@ -188,10 +179,6 @@ ShellCommandRunDmem (
               AcpiTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;\r
               continue;\r
             }\r
-            if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSalSystemTableGuid)) {\r
-              SalTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;\r
-              continue;\r
-            }\r
             if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) {\r
               SmbiosTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;\r
               continue;\r
@@ -206,7 +193,7 @@ ShellCommandRunDmem (
             }\r
           }\r
 \r
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle, \r
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle,\r
             (UINT64)(UINTN)Address,\r
             gST->Hdr.HeaderSize,\r
             gST->Hdr.Revision,\r