]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
ShellPkg: Standardized HP Copyright Message String
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / Dmem.c
index 0229450528ea603b0c9a05c71de5c1c17b68c0d1..05dc0d56d599fd0da4d7ef93a27fb75172de9927 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Main file for Dmem shell Debug1 function.\r
 \r
+  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -62,19 +63,19 @@ 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);\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
   ASSERT(Buffer != NULL);\r
 \r
-  Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)Address, Size, Buffer);\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, Status);\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)Address, Size);\r
-    DumpHex(2,0,Size,Buffer);\r
+    ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);\r
+    DumpHex(2, (UINTN)Address, Size, Buffer);\r
   }\r
 \r
   FreePool(Buffer);\r
@@ -133,7 +134,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, 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
@@ -141,7 +142,7 @@ ShellCommandRunDmem (
     }\r
   } else {\r
     if (ShellCommandLineGetCount(Package) > 3) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellDebug1HiiHandle);\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
@@ -150,7 +151,7 @@ ShellCommandRunDmem (
         Size = 512;\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_PROBLEM), gShellDebug1HiiHandle, Temp1);\r
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);  \r
           ShellStatus = SHELL_INVALID_PARAMETER;\r
         } \r
         Temp1 = ShellCommandLineGetRawValue(Package, 2);\r
@@ -158,7 +159,7 @@ ShellCommandRunDmem (
           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_PROBLEM), gShellDebug1HiiHandle, Temp1);\r
+            ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellDebug1HiiHandle, L"dmem", Temp1);  \r
             ShellStatus = SHELL_INVALID_PARAMETER;\r
           }\r
         }\r
@@ -167,8 +168,8 @@ ShellCommandRunDmem (
 \r
     if (ShellStatus == SHELL_SUCCESS) {\r
       if (!ShellCommandLineGetFlag(Package, L"-mmio")) {\r
-        ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)Address, Size);\r
-        DumpHex(2,0,(UINTN)Size,Address);\r
+        ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);\r
+        DumpHex(2, (UINTN)Address, (UINTN)Size, Address);\r
         if (Address == (VOID*)gST) {\r
           Acpi20TableAddress  = 0;\r
           AcpiTableAddress    = 0;\r
@@ -177,36 +178,36 @@ ShellCommandRunDmem (
           MpsTableAddress     = 0;\r
           for (TableWalker = 0 ; TableWalker < gST->NumberOfTableEntries ; TableWalker++) {\r
             if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi20TableGuid)) {\r
-              Acpi20TableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;\r
+              Acpi20TableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;\r
               continue;\r
             }\r
             if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi10TableGuid)) {\r
-              AcpiTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;\r
+              AcpiTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;\r
               continue;\r
             }\r
             if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSalSystemTableGuid)) {\r
-              SalTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;\r
+              SalTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;\r
               continue;\r
             }\r
             if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) {\r
-              SmbiosTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;\r
+              SmbiosTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;\r
               continue;\r
             }\r
             if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMpsTableGuid)) {\r
-              MpsTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable;\r
+              MpsTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;\r
               continue;\r
             }\r
           }\r
 \r
           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle, \r
-            (UINT64)Address,\r
+            (UINT64)(UINTN)Address,\r
             gST->Hdr.HeaderSize,\r
             gST->Hdr.Revision,\r
-            (UINT64)gST->ConIn,\r
-            (UINT64)gST->ConOut,\r
-            (UINT64)gST->StdErr,\r
-            (UINT64)gST->RuntimeServices,\r
-            (UINT64)gST->BootServices,\r
+            (UINT64)(UINTN)gST->ConIn,\r
+            (UINT64)(UINTN)gST->ConOut,\r
+            (UINT64)(UINTN)gST->StdErr,\r
+            (UINT64)(UINTN)gST->RuntimeServices,\r
+            (UINT64)(UINTN)gST->BootServices,\r
             SalTableAddress,\r
             AcpiTableAddress,\r
             Acpi20TableAddress,\r