]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
ShellPkg/dh: Modify the dump of GraphicsOutput protocol
[mirror_edk2.git] / ShellPkg / Library / UefiHandleParsingLib / UefiHandleParsingLib.c
index fb67197171176e352b0a78eb963152afebececc6..1c62415e8630f60d7756b9be0b5554b50e3366d5 100644 (file)
@@ -1094,6 +1094,71 @@ BlockIoProtocolDumpInformation (
   return RetVal;\r
 }\r
 \r
+/**\r
+  Function to dump information about DebugSupport Protocol.\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
+DebugSupportProtocolDumpInformation (\r
+  IN CONST EFI_HANDLE TheHandle,\r
+  IN CONST BOOLEAN    Verbose\r
+  )\r
+{\r
+  EFI_STATUS                  Status;\r
+  EFI_DEBUG_SUPPORT_PROTOCOL  *DebugSupport;\r
+  CHAR16                      *GetString;\r
+  CHAR16                      *RetVal;\r
+\r
+  if (!Verbose) {\r
+    return NULL;\r
+  }\r
+  GetString = NULL;\r
+  RetVal = NULL;\r
+  Status = gBS->OpenProtocol (\r
+                TheHandle,\r
+                &gEfiDebugSupportProtocolGuid,\r
+                (VOID**)&DebugSupport,\r
+                gImageHandle,\r
+                NULL,\r
+                EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+                );\r
+  if (EFI_ERROR (Status)) {\r
+    return NULL;\r
+  }\r
+  HandleParsingHiiInit ();\r
+  GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_DEBUGSUPPORT_INFO), NULL);\r
+  if (GetString == NULL) {\r
+    return NULL;\r
+  }\r
+  //\r
+  // Dump Debug support info\r
+  //\r
+  switch (DebugSupport->Isa) {\r
+  case (IsaIa32):\r
+    RetVal = CatSPrint (RetVal, GetString, L"IA-32");\r
+    break;\r
+  case (IsaIpf):\r
+    RetVal = CatSPrint (RetVal, GetString, L"IPF");\r
+    break;\r
+  case (IsaEbc):\r
+    RetVal = CatSPrint (RetVal, GetString, L"EBC");\r
+    break;\r
+  default:\r
+    SHELL_FREE_NON_NULL (GetString);\r
+    GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_DEBUGSUPPORT_UNKNOWN), NULL);\r
+    RetVal = GetString != NULL ? CatSPrint (RetVal, GetString, DebugSupport->Isa) : NULL;\r
+    break;\r
+  }\r
+\r
+  SHELL_FREE_NON_NULL (GetString);\r
+  return RetVal;\r
+}\r
+\r
 /**\r
   Function to dump information about EfiAdapterInformation Protocol.\r
 \r
@@ -1817,7 +1882,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_USB_IO),                &gEfiUsbIoProtocolGuid,                           NULL},\r
   {STRING_TOKEN(STR_USB_HC),                &gEfiUsbHcProtocolGuid,                           NULL},\r
   {STRING_TOKEN(STR_USB_HC2),               &gEfiUsb2HcProtocolGuid,                          NULL},\r
-  {STRING_TOKEN(STR_DEBUG_SUPPORT),         &gEfiDebugSupportProtocolGuid,                    NULL},\r
+  {STRING_TOKEN(STR_DEBUG_SUPPORT),         &gEfiDebugSupportProtocolGuid,                    DebugSupportProtocolDumpInformation},\r
   {STRING_TOKEN(STR_DEBUG_PORT),            &gEfiDebugPortProtocolGuid,                       NULL},\r
   {STRING_TOKEN(STR_DECOMPRESS),            &gEfiDecompressProtocolGuid,                      NULL},\r
   {STRING_TOKEN(STR_ACPI_TABLE),            &gEfiAcpiTableProtocolGuid,                       NULL},\r