From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DF3A52095E4F1 for ; Thu, 21 Sep 2017 22:47:17 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 21 Sep 2017 22:50:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="154738623" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.7]) by fmsmga006.fm.intel.com with ESMTP; 21 Sep 2017 22:50:24 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Huajing Li , Jaben Carsey Date: Fri, 22 Sep 2017 13:50:09 +0800 Message-Id: <20170922055014.27288-10-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 In-Reply-To: <20170922055014.27288-1-ruiyu.ni@intel.com> References: <20170922055014.27288-1-ruiyu.ni@intel.com> Subject: [PATCH 09/14] ShellPkg/dh: Modify the dump of DebugSupport protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Sep 2017 05:47:18 -0000 From: Huajing Li Reviewed-by: Ruiyu Ni Cc: Jaben Carsey Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Huajing Li --- .../UefiHandleParsingLib/UefiHandleParsingLib.c | 67 +++++++++++++++++++++- .../UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 + 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c index fb67197171..1c62415e86 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c @@ -1095,6 +1095,71 @@ BlockIoProtocolDumpInformation ( } /** + Function to dump information about DebugSupport Protocol. + + @param[in] TheHandle The handle that has the protocol installed. + @param[in] Verbose TRUE for additional information, FALSE otherwise. + + @retval A pointer to a string containing the information. +**/ +CHAR16* +EFIAPI +DebugSupportProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport; + CHAR16 *GetString; + CHAR16 *RetVal; + + if (!Verbose) { + return NULL; + } + GetString = NULL; + RetVal = NULL; + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiDebugSupportProtocolGuid, + (VOID**)&DebugSupport, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return NULL; + } + HandleParsingHiiInit (); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_DEBUGSUPPORT_INFO), NULL); + if (GetString == NULL) { + return NULL; + } + // + // Dump Debug support info + // + switch (DebugSupport->Isa) { + case (IsaIa32): + RetVal = CatSPrint (RetVal, GetString, L"IA-32"); + break; + case (IsaIpf): + RetVal = CatSPrint (RetVal, GetString, L"IPF"); + break; + case (IsaEbc): + RetVal = CatSPrint (RetVal, GetString, L"EBC"); + break; + default: + SHELL_FREE_NON_NULL (GetString); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_DEBUGSUPPORT_UNKNOWN), NULL); + RetVal = GetString != NULL ? CatSPrint (RetVal, GetString, DebugSupport->Isa) : NULL; + break; + } + + SHELL_FREE_NON_NULL (GetString); + return RetVal; +} + +/** Function to dump information about EfiAdapterInformation Protocol. @param[in] TheHandle The handle that has the protocol installed. @@ -1817,7 +1882,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = { {STRING_TOKEN(STR_USB_IO), &gEfiUsbIoProtocolGuid, NULL}, {STRING_TOKEN(STR_USB_HC), &gEfiUsbHcProtocolGuid, NULL}, {STRING_TOKEN(STR_USB_HC2), &gEfiUsb2HcProtocolGuid, NULL}, - {STRING_TOKEN(STR_DEBUG_SUPPORT), &gEfiDebugSupportProtocolGuid, NULL}, + {STRING_TOKEN(STR_DEBUG_SUPPORT), &gEfiDebugSupportProtocolGuid, DebugSupportProtocolDumpInformation}, {STRING_TOKEN(STR_DEBUG_PORT), &gEfiDebugPortProtocolGuid, NULL}, {STRING_TOKEN(STR_DECOMPRESS), &gEfiDecompressProtocolGuid, NULL}, {STRING_TOKEN(STR_ACPI_TABLE), &gEfiAcpiTableProtocolGuid, NULL}, diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni index eeb6aded6f..ca5e362bc7 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni @@ -336,6 +336,8 @@ #string STR_IDE_CONT_INIT #language en-US "IdeControllerInit" #string STR_DISK_INFO #language en-US "DiskInfo" #string STR_BLOCKIO_INFO #language en-US " %s%sMId:%%H%x%%N bsize %%H%x%%N, lblock %lx (%,ld), %s %s %s" +#string STR_DEBUGSUPPORT_INFO #language en-US " Isa = %s" +#string STR_DEBUGSUPPORT_UNKNOWN #language en-US " Unknown (%%H%s%%N)" #string STR_PCIRB_DUMP_PH #language en-US " ParentHandle..: %H%x%N\r\n" #string STR_PCIRB_DUMP_SEG #language en-US " Segment #.....: %H%x%N\r\n" -- 2.12.2.windows.2