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 195A42095E4E2 for ; Thu, 21 Sep 2017 22:47:16 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 21 Sep 2017 22:50:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="154738612" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.7]) by fmsmga006.fm.intel.com with ESMTP; 21 Sep 2017 22:50:22 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Huajing Li , Jaben Carsey Date: Fri, 22 Sep 2017 13:50:07 +0800 Message-Id: <20170922055014.27288-8-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 07/14] ShellPkg/dh: Modify the dump of BusSpecificDriverOverride 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:16 -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 | 81 +++++++++++++++++++++- .../UefiHandleParsingLib/UefiHandleParsingLib.uni | 2 +- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c index b9eb564dd0..ce2b49b5a2 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c @@ -938,6 +938,85 @@ LoadedImageDevicePathProtocolDumpInformation( } /** + Function to dump information about BusSpecificDriverOverride protocol. + + This will allocate the return buffer from boot services pool. + + @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 +BusSpecificDriverOverrideProtocolDumpInformation ( + IN CONST EFI_HANDLE TheHandle, + IN CONST BOOLEAN Verbose + ) +{ + EFI_STATUS Status; + CHAR16 *GetString; + CHAR16 *RetVal; + CHAR16 *TempRetVal; + EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *BusSpecificDriverOverride; + EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; + EFI_HANDLE ImageHandle; + UINTN Size; + + if (!Verbose) { + return NULL; + } + Size = 0; + GetString = NULL; + RetVal = NULL; + TempRetVal = NULL; + ImageHandle = 0; + + Status = gBS->OpenProtocol ( + TheHandle, + &gEfiBusSpecificDriverOverrideProtocolGuid, + (VOID**)&BusSpecificDriverOverride, + gImageHandle, + NULL, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return NULL; + } + HandleParsingHiiInit (); + GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_BSDO_DUMP_MAIN), NULL); + if (GetString == NULL) { + return NULL; + } + do { + Status = BusSpecificDriverOverride->GetDriver ( + BusSpecificDriverOverride, + &ImageHandle + ); + if (!EFI_ERROR (Status)) { + Status = gBS->HandleProtocol ( + ImageHandle, + &gEfiLoadedImageProtocolGuid, + (VOID **) &LoadedImage + ); + if(!EFI_ERROR (Status)) { + TempRetVal = CatSPrint ( + TempRetVal, + GetString, + ConvertHandleToHandleIndex (ImageHandle), + ConvertDevicePathToText (LoadedImage->FilePath, TRUE, TRUE) + ); + StrnCatGrow (&RetVal, &Size, TempRetVal, 0); + SHELL_FREE_NON_NULL (TempRetVal); + } + } + } while (!EFI_ERROR (Status)); + + SHELL_FREE_NON_NULL (GetString); + return RetVal; +} + +/** Function to dump information about EfiAdapterInformation Protocol. @param[in] TheHandle The handle that has the protocol installed. @@ -1623,7 +1702,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = { {STRING_TOKEN(STR_DEVICE_PATH_VTUTF8), &gEfiVTUTF8Guid, NULL}, {STRING_TOKEN(STR_DRIVER_BINDING), &gEfiDriverBindingProtocolGuid, NULL}, {STRING_TOKEN(STR_PLATFORM_OVERRIDE), &gEfiPlatformDriverOverrideProtocolGuid, NULL}, - {STRING_TOKEN(STR_BUS_OVERRIDE), &gEfiBusSpecificDriverOverrideProtocolGuid, NULL}, + {STRING_TOKEN(STR_BUS_OVERRIDE), &gEfiBusSpecificDriverOverrideProtocolGuid, BusSpecificDriverOverrideProtocolDumpInformation}, {STRING_TOKEN(STR_DRIVER_DIAG), &gEfiDriverDiagnosticsProtocolGuid, NULL}, {STRING_TOKEN(STR_DRIVER_DIAG2), &gEfiDriverDiagnostics2ProtocolGuid, NULL}, {STRING_TOKEN(STR_DRIVER_CN), &gEfiComponentNameProtocolGuid, NULL}, diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni index 8541399b68..3f9fc9cbac 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni @@ -384,7 +384,7 @@ #string STR_GOP_RES_LIST_ENTRY #language en-US " Resolution[%%H%d%%N]:\r\n" " Res Hor.........: %%H0x%08x%%N\r\n" " Res Ver.........: %%H0x%08x%%N\r\n" - +#string STR_BSDO_DUMP_MAIN #language en-US " Drv[%02x] File:%%H%s%%N" #string STR_EDID_DISCOVERED_MAIN #language en-US " EDID Discovered Size : %%H0x%08x%%N\r\n" #string STR_EDID_DISCOVERED_DATA #language en-US " EDID Discovered Data :\r\n" #string STR_EDID_ACTIVE_MAIN #language en-US " EDID Active Size : %%H0x%08x%%N\r\n" -- 2.12.2.windows.2