]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
ShellPkg/UefiHandleParsingLib: Remove some unused Guids
[mirror_edk2.git] / ShellPkg / Library / UefiHandleParsingLib / UefiHandleParsingLib.c
index d12466c7b04e63a8baf9b7b5d09d36b81a5bebfe..f179c410922361e13467a8b9527fbde8cfd6ee82 100644 (file)
@@ -4,13 +4,7 @@
   Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>\r
   (C) Copyright 2015-2016 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
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -259,9 +253,7 @@ LoadedImageProtocolDumpInformation(
     } else {\r
       SHELL_FREE_NON_NULL(FilePath);\r
     }\r
-    RetVal = CatSPrint(NULL, FileName);\r
-    SHELL_FREE_NON_NULL(FileName);\r
-    return RetVal;\r
+    return FileName;\r
   }\r
 \r
   HandleParsingHiiInit();\r
@@ -684,7 +676,7 @@ PciRootBridgeIoDumpInformation(
         break;\r
       }\r
       if (Temp != NULL) {\r
-        Temp2 = CatSPrint(RetVal, L"%s", Temp);\r
+        Temp2 = CatSPrint(RetVal, L"\r\n%s", Temp);\r
         FreePool(Temp);\r
         FreePool(RetVal);\r
         RetVal = Temp2;\r
@@ -692,7 +684,7 @@ PciRootBridgeIoDumpInformation(
       }\r
 \r
       Temp2 = CatSPrint(RetVal,\r
-        L"\r\n%%H%02x    %016lx  %016lx  %02x%%N",\r
+        L"%%H%02x    %016lx  %016lx  %02x%%N",\r
         Configuration->SpecificFlag,\r
         Configuration->AddrRangeMin,\r
         Configuration->AddrRangeMax,\r
@@ -1933,6 +1925,87 @@ ERROR_EXIT:
   return NULL;\r
 }\r
 \r
+/**\r
+  Function to dump information about Partition Information protocol.\r
+\r
+  This will allocate the return buffer from boot services pool.\r
+\r
+  @param[in] TheHandle      The handle that has the protocol installed.\r
+  @param[in] Verbose        TRUE for additional information, FALSE otherwise.\r
+\r
+  @retval A pointer to a string containing the information.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+PartitionInfoProtocolDumpInformation (\r
+  IN CONST EFI_HANDLE TheHandle,\r
+  IN CONST BOOLEAN    Verbose\r
+  )\r
+{\r
+  EFI_STATUS                      Status;\r
+  EFI_PARTITION_INFO_PROTOCOL     *PartitionInfo;\r
+  CHAR16                          *PartitionType;\r
+  CHAR16                          *EfiSystemPartition;\r
+  CHAR16                          *RetVal;\r
+\r
+  if (!Verbose) {\r
+    return NULL;\r
+  }\r
+\r
+  Status = gBS->OpenProtocol (\r
+                TheHandle,\r
+                &gEfiPartitionInfoProtocolGuid,\r
+                (VOID**)&PartitionInfo,\r
+                gImageHandle,\r
+                NULL,\r
+                EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+                );\r
+  if (EFI_ERROR (Status)) {\r
+    return NULL;\r
+  }\r
+\r
+  HandleParsingHiiInit ();\r
+\r
+  switch (PartitionInfo->Type) {\r
+  case PARTITION_TYPE_OTHER:\r
+    PartitionType = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_TYPE_OTHER), NULL);\r
+    break;\r
+  case PARTITION_TYPE_MBR:\r
+    PartitionType = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_TYPE_MBR), NULL);\r
+    break;\r
+  case PARTITION_TYPE_GPT:\r
+    PartitionType = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_TYPE_GPT), NULL);\r
+    break;\r
+  default:\r
+    PartitionType = NULL;\r
+    break;\r
+  }\r
+  if (PartitionType == NULL) {\r
+    return NULL;\r
+  }\r
+\r
+  if (PartitionInfo->System == 1) {\r
+    EfiSystemPartition = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_EFI_SYS_PART), NULL);\r
+  } else {\r
+    EfiSystemPartition = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_PARTINFO_DUMP_NOT_EFI_SYS_PART), NULL);\r
+  }\r
+  if (EfiSystemPartition == NULL) {\r
+    SHELL_FREE_NON_NULL (PartitionType);\r
+    return NULL;\r
+  }\r
+\r
+  RetVal = CatSPrint (\r
+             NULL,\r
+             L"%s\r\n%s",\r
+             PartitionType,\r
+             EfiSystemPartition\r
+             );\r
+\r
+  SHELL_FREE_NON_NULL (EfiSystemPartition);\r
+  SHELL_FREE_NON_NULL (PartitionType);\r
+  return RetVal;\r
+}\r
+\r
 //\r
 // Put the information on the NT32 protocol GUIDs here so we are not dependant on the Nt32Pkg\r
 //\r
@@ -2146,6 +2219,37 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_DISK_IO2),              &gEfiDiskIo2ProtocolGuid,                         NULL},\r
   {STRING_TOKEN(STR_ADAPTER_INFO),          &gEfiAdapterInformationProtocolGuid,              AdapterInformationDumpInformation},\r
 \r
+//\r
+// UEFI2.5\r
+//\r
+  {STRING_TOKEN(STR_TLS_SB),                &gEfiTlsServiceBindingProtocolGuid,              NULL},\r
+  {STRING_TOKEN(STR_TLS),                   &gEfiTlsProtocolGuid,                            NULL},\r
+  {STRING_TOKEN(STR_TLS_CONFIG),            &gEfiTlsConfigurationProtocolGuid,               NULL},\r
+  {STRING_TOKEN(STR_SUPPLICANT_SB),         &gEfiSupplicantServiceBindingProtocolGuid,       NULL},\r
+  {STRING_TOKEN(STR_SUPPLICANT),            &gEfiSupplicantProtocolGuid,                     NULL},\r
+\r
+//\r
+// UEFI2.6\r
+//\r
+  {STRING_TOKEN(STR_WIFI2),                 &gEfiWiFi2ProtocolGuid,                          NULL},\r
+  {STRING_TOKEN(STR_RAMDISK),               &gEfiRamDiskProtocolGuid,                        NULL},\r
+  {STRING_TOKEN(STR_HII_ID),                &gEfiHiiImageDecoderProtocolGuid,                NULL},\r
+  {STRING_TOKEN(STR_HII_IE),                &gEfiHiiImageExProtocolGuid,                     NULL},\r
+  {STRING_TOKEN(STR_SD_MPT),                &gEfiSdMmcPassThruProtocolGuid,                  NULL},\r
+  {STRING_TOKEN(STR_ERASE_BLOCK),           &gEfiEraseBlockProtocolGuid,                     NULL},\r
+\r
+//\r
+// UEFI2.7\r
+//\r
+  {STRING_TOKEN(STR_BLUETOOTH_ATTR),        &gEfiBluetoothAttributeProtocolGuid,               NULL},\r
+  {STRING_TOKEN(STR_BLUETOOTH_ATTR_SB),     &gEfiBluetoothAttributeServiceBindingProtocolGuid, NULL},\r
+  {STRING_TOKEN(STR_BLUETOOTH_LE_CONFIG),   &gEfiBluetoothLeConfigProtocolGuid,                NULL},\r
+  {STRING_TOKEN(STR_UFS_DEV_CONFIG),        &gEfiUfsDeviceConfigProtocolGuid,                  NULL},\r
+  {STRING_TOKEN(STR_HTTP_BOOT_CALL),        &gEfiHttpBootCallbackProtocolGuid,                 NULL},\r
+  {STRING_TOKEN(STR_RESET_NOTI),            &gEfiResetNotificationProtocolGuid,                NULL},\r
+  {STRING_TOKEN(STR_PARTITION_INFO),        &gEfiPartitionInfoProtocolGuid,                    PartitionInfoProtocolDumpInformation},\r
+  {STRING_TOKEN(STR_HII_POPUP),             &gEfiHiiPopupProtocolGuid,                         NULL},\r
+\r
 //\r
 // PI Spec ones\r
 //\r
@@ -2198,7 +2302,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_S_COMM),                &gEfiSmmCommunicationProtocolGuid,                NULL},\r
   {STRING_TOKEN(STR_S_STAT),                &gEfiSmmStatusCodeProtocolGuid,                   NULL},\r
   {STRING_TOKEN(STR_S_CPU),                 &gEfiSmmCpuProtocolGuid,                          NULL},\r
-  {STRING_TOKEN(STR_S_PCIRBIO),             &gEfiPciRootBridgeIoProtocolGuid,                 NULL},\r
+  {STRING_TOKEN(STR_S_PCIRBIO),             &gEfiSmmPciRootBridgeIoProtocolGuid,              NULL},\r
   {STRING_TOKEN(STR_S_SWD),                 &gEfiSmmSwDispatch2ProtocolGuid,                  NULL},\r
   {STRING_TOKEN(STR_S_SXD),                 &gEfiSmmSxDispatch2ProtocolGuid,                  NULL},\r
   {STRING_TOKEN(STR_S_PTD2),                &gEfiSmmPeriodicTimerDispatch2ProtocolGuid,       NULL},\r
@@ -2211,23 +2315,6 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_FVB2),                  &gEfiFirmwareVolumeBlock2ProtocolGuid,            NULL},\r
   {STRING_TOKEN(STR_CPUIO2),                &gEfiCpuIo2ProtocolGuid,                          NULL},\r
   {STRING_TOKEN(STR_LEGACY_R2),             &gEfiLegacyRegion2ProtocolGuid,                   NULL},\r
-  {STRING_TOKEN(STR_SAL_MIP),               &gEfiSalMcaInitPmiProtocolGuid,                   NULL},\r
-  {STRING_TOKEN(STR_ES_BS),                 &gEfiExtendedSalBootServiceProtocolGuid,          NULL},\r
-  {STRING_TOKEN(STR_ES_BIO),                &gEfiExtendedSalBaseIoServicesProtocolGuid,       NULL},\r
-  {STRING_TOKEN(STR_ES_STALL),              &gEfiExtendedSalStallServicesProtocolGuid,        NULL},\r
-  {STRING_TOKEN(STR_ES_RTC),                &gEfiExtendedSalRtcServicesProtocolGuid,          NULL},\r
-  {STRING_TOKEN(STR_ES_VS),                 &gEfiExtendedSalVariableServicesProtocolGuid,     NULL},\r
-  {STRING_TOKEN(STR_ES_MTC),                &gEfiExtendedSalMtcServicesProtocolGuid,          NULL},\r
-  {STRING_TOKEN(STR_ES_RESET),              &gEfiExtendedSalResetServicesProtocolGuid,        NULL},\r
-  {STRING_TOKEN(STR_ES_SC),                 &gEfiExtendedSalStatusCodeServicesProtocolGuid,   NULL},\r
-  {STRING_TOKEN(STR_ES_FBS),                &gEfiExtendedSalFvBlockServicesProtocolGuid,      NULL},\r
-  {STRING_TOKEN(STR_ES_MP),                 &gEfiExtendedSalMpServicesProtocolGuid,           NULL},\r
-  {STRING_TOKEN(STR_ES_PAL),                &gEfiExtendedSalPalServicesProtocolGuid,          NULL},\r
-  {STRING_TOKEN(STR_ES_BASE),               &gEfiExtendedSalBaseServicesProtocolGuid,         NULL},\r
-  {STRING_TOKEN(STR_ES_MCA),                &gEfiExtendedSalMcaServicesProtocolGuid,          NULL},\r
-  {STRING_TOKEN(STR_ES_PCI),                &gEfiExtendedSalPciServicesProtocolGuid,          NULL},\r
-  {STRING_TOKEN(STR_ES_CACHE),              &gEfiExtendedSalCacheServicesProtocolGuid,        NULL},\r
-  {STRING_TOKEN(STR_ES_MCA_LOG),            &gEfiExtendedSalMcaLogServicesProtocolGuid,       NULL},\r
   {STRING_TOKEN(STR_S2ARCH),                &gEfiSecurity2ArchProtocolGuid,                   NULL},\r
   {STRING_TOKEN(STR_EODXE),                 &gEfiSmmEndOfDxeProtocolGuid,                     NULL},\r
   {STRING_TOKEN(STR_ISAHC),                 &gEfiIsaHcProtocolGuid,                           NULL},\r
@@ -2239,7 +2326,6 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_I2CEN),                 &gEfiI2cEnumerateProtocolGuid,                    NULL},\r
   {STRING_TOKEN(STR_I2C_H),                 &gEfiI2cHostProtocolGuid,                         NULL},\r
   {STRING_TOKEN(STR_I2C_BCM),               &gEfiI2cBusConfigurationManagementProtocolGuid,   NULL},\r
-  {STRING_TOKEN(STR_TREE),                  &gEfiTrEEProtocolGuid,                            NULL},\r
   {STRING_TOKEN(STR_TCG2),                  &gEfiTcg2ProtocolGuid,                            NULL},\r
   {STRING_TOKEN(STR_TIMESTAMP),             &gEfiTimestampProtocolGuid,                       NULL},\r
   {STRING_TOKEN(STR_RNG),                   &gEfiRngProtocolGuid,                             NULL},\r
@@ -2270,6 +2356,31 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_NET_HTTP_U),            &gEfiHttpUtilitiesProtocolGuid,                   NULL},\r
   {STRING_TOKEN(STR_REST),                  &gEfiRestProtocolGuid,                            NULL},\r
 \r
+//\r
+// PI 1.5\r
+//\r
+  {STRING_TOKEN(STR_MM_EOD),                &gEfiMmEndOfDxeProtocolGuid,                      NULL},\r
+  {STRING_TOKEN(STR_MM_ITD),                &gEfiMmIoTrapDispatchProtocolGuid,                NULL},\r
+  {STRING_TOKEN(STR_MM_PBD),                &gEfiMmPowerButtonDispatchProtocolGuid,           NULL},\r
+  {STRING_TOKEN(STR_MM_SBD),                &gEfiMmStandbyButtonDispatchProtocolGuid,         NULL},\r
+  {STRING_TOKEN(STR_MM_GD),                 &gEfiMmGpiDispatchProtocolGuid,                   NULL},\r
+  {STRING_TOKEN(STR_MM_UD),                 &gEfiMmUsbDispatchProtocolGuid,                   NULL},\r
+  {STRING_TOKEN(STR_MM_PTD),                &gEfiMmPeriodicTimerDispatchProtocolGuid,         NULL},\r
+  {STRING_TOKEN(STR_MM_SXD),                &gEfiMmSxDispatchProtocolGuid,                    NULL},\r
+  {STRING_TOKEN(STR_MM_SWD),                &gEfiMmSwDispatchProtocolGuid,                    NULL},\r
+  {STRING_TOKEN(STR_MM_PRBI),               &gEfiMmPciRootBridgeIoProtocolGuid,               NULL},\r
+  {STRING_TOKEN(STR_MM_CPU),                &gEfiMmCpuProtocolGuid,                           NULL},\r
+  {STRING_TOKEN(STR_MM_STACODE),            &gEfiMmStatusCodeProtocolGuid,                    NULL},\r
+  {STRING_TOKEN(STR_DXEMM_RTL),             &gEfiDxeMmReadyToLockProtocolGuid,                NULL},\r
+  {STRING_TOKEN(STR_MM_CONFIG),             &gEfiMmConfigurationProtocolGuid,                 NULL},\r
+  {STRING_TOKEN(STR_MM_RTL),                &gEfiMmReadyToLockProtocolGuid,                   NULL},\r
+  {STRING_TOKEN(STR_MM_CONTROL),            &gEfiMmControlProtocolGuid,                       NULL},\r
+  {STRING_TOKEN(STR_MM_ACCESS),             &gEfiMmAccessProtocolGuid,                        NULL},\r
+  {STRING_TOKEN(STR_MM_BASE),               &gEfiMmBaseProtocolGuid,                          NULL},\r
+  {STRING_TOKEN(STR_MM_CPUIO),              &gEfiMmCpuIoProtocolGuid,                         NULL},\r
+  {STRING_TOKEN(STR_MM_RH),                 &gEfiMmRscHandlerProtocolGuid,                    NULL},\r
+  {STRING_TOKEN(STR_MM_COM),                &gEfiMmCommunicationProtocolGuid,                 NULL},\r
+\r
 //\r
 // UEFI Shell Spec 2.0\r
 //\r