diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2013-07-26 03:14:08 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-07-26 03:14:08 +0000 |
commit | 863986b3c8e67736d361b68e293d01e6f92f825c (patch) | |
tree | 15cf067d949655c9defeeeaa78eeea6050845b64 /ShellPkg | |
parent | 4d0a30a494599226450bf69ad9d6fc689f61712e (diff) | |
download | edk2-platforms-863986b3c8e67736d361b68e293d01e6f92f825c.tar.xz |
Update all the code to consume the ConvertDevicePathToText, ConvertDevicePathNodeToText, ConvertTextToDevicePath and ConvertTextToDeviceNode APIs in DevicePathLib.
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14505 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
27 files changed, 65 insertions, 144 deletions
diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf index 756e84137e..c3af617430 100644 --- a/ShellPkg/Application/Shell/Shell.inf +++ b/ShellPkg/Application/Shell/Shell.inf @@ -1,7 +1,7 @@ ## @file
# This is the shell application
#
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -93,7 +93,6 @@ gEfiComponentName2ProtocolGuid # ALWAYS_CONSUMED
gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED
gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED
- gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED
[Pcd]
gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c index df4874a23c..d39114f50e 100644 --- a/ShellPkg/Application/Shell/ShellProtocol.c +++ b/ShellPkg/Application/Shell/ShellProtocol.c @@ -115,27 +115,18 @@ InternalShellProtocolDebugPrintMessage ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
{
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;
EFI_STATUS Status;
CHAR16 *Temp;
- Status = EFI_SUCCESS;
DEBUG_CODE_BEGIN();
- DevicePathToText = NULL;
- Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid,
- NULL,
- (VOID**)&DevicePathToText);
if (Mapping != NULL) {
DEBUG((EFI_D_INFO, "Added new map item:\"%S\"\r\n", Mapping));
}
- if (!EFI_ERROR(Status)) {
- if (DevicePath != NULL) {
- Temp = DevicePathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE);
- DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));
- FreePool(Temp);
- }
- }
+ Temp = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
+ DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));
+ FreePool(Temp);
+
DEBUG_CODE_END();
return (Status);
}
@@ -647,7 +638,6 @@ EfiShellGetDeviceName( {
EFI_STATUS Status;
EFI_COMPONENT_NAME2_PROTOCOL *CompName2;
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_HANDLE *HandleList;
UINTN HandleCount;
@@ -815,28 +805,19 @@ EfiShellGetDeviceName( }
}
if ((Flags & EFI_DEVICE_NAME_USE_DEVICE_PATH) != 0) {
- Status = gBS->LocateProtocol(
- &gEfiDevicePathToTextProtocolGuid,
+ Status = gBS->OpenProtocol(
+ DeviceHandle,
+ &gEfiDevicePathProtocolGuid,
+ (VOID**)&DevicePath,
+ gImageHandle,
NULL,
- (VOID**)&DevicePathToText);
- //
- // we now have the device path to text protocol
- //
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (!EFI_ERROR(Status)) {
- Status = gBS->OpenProtocol(
- DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID**)&DevicePath,
- gImageHandle,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- //
- // use device path to text on the device path
- //
- *BestDeviceName = DevicePathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE);
- return (EFI_SUCCESS);
- }
+ //
+ // use device path to text on the device path
+ //
+ *BestDeviceName = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
+ return (EFI_SUCCESS);
}
}
//
@@ -1583,11 +1564,11 @@ EfiShellExecute( DevPath = AppendDevicePath (ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath);
DEBUG_CODE_BEGIN();
- Temp = gDevPathToText->ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE);
+ Temp = ConvertDevicePathToText(ShellInfoObject.FileDevPath, TRUE, TRUE);
FreePool(Temp);
- Temp = gDevPathToText->ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE);
+ Temp = ConvertDevicePathToText(ShellInfoObject.ImageDevPath, TRUE, TRUE);
FreePool(Temp);
- Temp = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, TRUE);
+ Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE);
FreePool(Temp);
DEBUG_CODE_END();
diff --git a/ShellPkg/Include/Library/ShellCommandLib.h b/ShellPkg/Include/Library/ShellCommandLib.h index 0f4f503410..13d526edf7 100644 --- a/ShellPkg/Include/Library/ShellCommandLib.h +++ b/ShellPkg/Include/Library/ShellCommandLib.h @@ -4,7 +4,7 @@ This library is for use ONLY by shell commands linked into the shell application.
This library will not funciton if it is used for UEFI Shell 2.0 Applications.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -24,7 +24,6 @@ #include <Protocol/EfiShell.h>
#include <Protocol/EfiShellParameters.h>
#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePathToText.h>
#include <Protocol/SimpleFileSystem.h>
#include <Library/UefiBootServicesTableLib.h>
@@ -33,7 +32,6 @@ // The extern global protocol poionters.
//
extern EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation;
-extern EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText;
extern CONST CHAR16* SupportLevel[];
//
diff --git a/ShellPkg/Library/UefiDpLib/DpUtilities.c b/ShellPkg/Library/UefiDpLib/DpUtilities.c index 89c9919e03..57c81288da 100644 --- a/ShellPkg/Library/UefiDpLib/DpUtilities.c +++ b/ShellPkg/Library/UefiDpLib/DpUtilities.c @@ -31,7 +31,6 @@ #include <Protocol/DriverBinding.h>
#include <Protocol/ComponentName2.h>
#include <Protocol/DevicePath.h>
-#include <Protocol/DevicePathToText.h>
#include <Guid/Performance.h>
@@ -204,7 +203,6 @@ GetNameFromHandle ( UINTN StringSize;
CHAR8 *PlatformLanguage;
EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;
//
// Method 1: Get the name string from image PDB
@@ -320,19 +318,12 @@ GetNameFromHandle ( //
// Method 5: Get the name string from image DevicePath
//
- Status = gBS->LocateProtocol (
- &gEfiDevicePathToTextProtocolGuid,
- NULL,
- (VOID **) &DevicePathToText
- );
- if (!EFI_ERROR (Status)) {
- NameString = DevicePathToText->ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);
- if (NameString != NULL) {
- StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);
- mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
- FreePool (NameString);
- return;
- }
+ NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);
+ if (NameString != NULL) {
+ StrnCpy (mGaugeString, NameString, DP_GAUGE_STRING_LENGTH);
+ mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
+ FreePool (NameString);
+ return;
}
}
}
diff --git a/ShellPkg/Library/UefiDpLib/UefiDpLib.h b/ShellPkg/Library/UefiDpLib/UefiDpLib.h index 2cec991483..d16f55fe02 100644 --- a/ShellPkg/Library/UefiDpLib/UefiDpLib.h +++ b/ShellPkg/Library/UefiDpLib/UefiDpLib.h @@ -25,7 +25,6 @@ extern EFI_GUID gDpHiiGuid; #include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePathToText.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
diff --git a/ShellPkg/Library/UefiDpLib/UefiDpLib.inf b/ShellPkg/Library/UefiDpLib/UefiDpLib.inf index cb53a59496..9488a49813 100644 --- a/ShellPkg/Library/UefiDpLib/UefiDpLib.inf +++ b/ShellPkg/Library/UefiDpLib/UefiDpLib.inf @@ -62,13 +62,13 @@ UefiBootServicesTableLib
SortLib
PrintLib
+ DevicePathLib
[Protocols]
gEfiLoadedImageProtocolGuid # ALWAYS_CONSUMED
gEfiDriverBindingProtocolGuid # SOMETIMES_CONSUMED
gEfiComponentName2ProtocolGuid # SOMETIMES_CONSUMED
gEfiLoadedImageDevicePathProtocolGuid # SOMETIMES_CONSUMED
- gEfiDevicePathToTextProtocolGuid # SOMETIMES_CONSUMED
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c index 45ee9bd5d0..0c78d0da20 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c @@ -414,19 +414,15 @@ DevicePathProtocolDumpInformation( CHAR16 *Temp;
CHAR16 *Temp2;
EFI_STATUS Status;
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
Temp = NULL;
- Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID**)&DevPathToText);
+ Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (!EFI_ERROR(Status)) {
- Status = gBS->OpenProtocol(TheHandle, &gEfiDevicePathProtocolGuid, (VOID**)&DevPath, gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (!EFI_ERROR(Status)) {
- //
- // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line)
- //
- Temp = DevPathToText->ConvertDevicePathToText(DevPath, TRUE, TRUE);
- gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL);
- }
+ //
+ // I cannot decide whether to allow shortcuts here (the second BOOLEAN on the next line)
+ //
+ Temp = ConvertDevicePathToText(DevPath, TRUE, TRUE);
+ gBS->CloseProtocol(TheHandle, &gEfiDevicePathProtocolGuid, gImageHandle, NULL);
}
if (!Verbose && Temp != NULL && StrLen(Temp) > 30) {
Temp2 = NULL;
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c index 88c78ee15e..935e8397fe 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c @@ -30,7 +30,6 @@ STATIC BUFFER_LIST mFileHandleList; // global variables required by library class.
EFI_UNICODE_COLLATION_PROTOCOL *gUnicodeCollation = NULL;
-EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *gDevPathToText = NULL;
SHELL_MAP_LIST gShellMapList;
SHELL_MAP_LIST *gShellCurDir = NULL;
@@ -58,12 +57,6 @@ CommandInit( return (EFI_DEVICE_ERROR);
}
}
- if (gDevPathToText == NULL) {
- Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID**)&gDevPathToText);
- if (EFI_ERROR(Status)) {
- return (EFI_DEVICE_ERROR);
- }
- }
return (EFI_SUCCESS);
}
@@ -184,7 +177,6 @@ ShellCommandLibDestructor ( }
gUnicodeCollation = NULL;
- gDevPathToText = NULL;
gShellCurDir = NULL;
return (RETURN_SUCCESS);
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf index 6b3d774f47..5768059487 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf @@ -1,7 +1,7 @@ ## @file
# Provides interface to shell internal functions for shell commands.
#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved. <BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. <BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -52,7 +52,6 @@ gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED
gEfiShellProtocolGuid # ALWAYS_CONSUMED
gEfiShellParametersProtocolGuid # ALWAYS_CONSUMED
- gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED
[Guids]
gEfiSasDevicePathGuid # ALWAYS_CONSUMED
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c index c26fad7b38..87f2383fad 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c @@ -1,7 +1,7 @@ /** @file
Main file for bcfg shell Debug1 function.
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1052,7 +1052,7 @@ BcfgDisplayDumpDebug1( if ((*(UINT16*)(Buffer+4)) != 0) {
DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4));
CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4));
- DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE);
+ DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
} else {
DevPath = NULL;
DevPathString = NULL;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c index 34eb6af8ac..8d26c9d93b 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SetVar.c @@ -1,7 +1,7 @@ /** @file
Main file for SetVar shell Debug1 function.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -49,7 +49,6 @@ ShellCommandRunSetVar ( UINTN Size;
UINTN LoopVar;
EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *DevPathFromText;
ShellStatus = SHELL_SUCCESS;
Status = EFI_SUCCESS;
@@ -226,9 +225,7 @@ ShellCommandRunSetVar ( //
Data++;
Data++;
- Status = gBS->LocateProtocol(&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID**)&DevPathFromText);
- ASSERT_EFI_ERROR(Status);
- DevPath = DevPathFromText->ConvertTextToDevicePath(Data);
+ DevPath = ConvertTextToDevicePath(Data);
if (DevPath == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SETVAR_ERROR_DPFT), gShellDebug1HiiHandle, Status);
ShellStatus = SHELL_INVALID_PARAMETER;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h index bbc539126b..d8755bfefc 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h @@ -1,7 +1,7 @@ /** @file
Main file for NULL named library for Profile1 shell command functions.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -29,7 +29,6 @@ #include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePathToText.h>
#include <Protocol/DriverDiagnostics2.h>
#include <Protocol/DriverDiagnostics.h>
#include <Protocol/PlatformDriverOverride.h>
@@ -38,7 +37,6 @@ #include <Protocol/DriverSupportedEfiVersion.h>
#include <Protocol/DriverFamilyOverride.h>
#include <Protocol/DriverHealth.h>
-#include <Protocol/DevicePathFromText.h>
#include <Protocol/SimplePointer.h>
#include <Protocol/PciRootBridgeIo.h>
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c index 9947c56117..bfbd8d76b0 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c @@ -1,7 +1,7 @@ /** @file
Main file for Dh shell Driver1 function.
- Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -260,7 +260,7 @@ GetDriverImageName ( return (Status);
}
DevicePath = LoadedImage->FilePath;
- *Name = gDevPathToText->ConvertDevicePathToText(DevicePath, TRUE, TRUE);
+ *Name = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
return (EFI_SUCCESS);
}
@@ -354,7 +354,7 @@ DisplayDriverModelHandle ( ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DH_OUTPUT_DRIVER1), gShellDriver1HiiHandle, TempStringPointer!=NULL?TempStringPointer:L"<Unknown>");
SHELL_FREE_NON_NULL(TempStringPointer);
- TempStringPointer = gDevPathToText->ConvertDevicePathToText(DevicePath, TRUE, FALSE);
+ TempStringPointer = ConvertDevicePathToText(DevicePath, TRUE, FALSE);
ShellPrintHiiEx(
-1,
-1,
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c index 1f7675b8b5..fe314f70f8 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Drivers.c @@ -1,7 +1,7 @@ /** @file
Main file for Drivers shell Driver1 function.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -80,7 +80,7 @@ GetDevicePathTextForHandle( }
RetVal = gEfiShellProtocol->GetFilePathFromDevicePath(FinalPath);
if (RetVal == NULL) {
- RetVal = gDevPathToText->ConvertDevicePathToText(FinalPath, TRUE, TRUE);
+ RetVal = ConvertDevicePathToText(FinalPath, TRUE, TRUE);
}
FreePool(FinalPath);
return (RetVal);
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c index b82bdf8f36..35ddd441b1 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c @@ -1,7 +1,7 @@ /** @file
Main file for DrvCfg shell Driver1 function.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -406,7 +406,7 @@ ConfigFromFile( //
// print out an error.
//
- TempDevPathString = gDevPathToText->ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE);
+ TempDevPathString = ConvertDevicePathToText((EFI_DEVICE_PATH_PROTOCOL*)(((CHAR8*)PackageHeader) + sizeof(EFI_HII_PACKAGE_HEADER)), TRUE, TRUE);
ShellPrintHiiEx(
-1,
-1,
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h index 19633a4b71..46ba8fdd8f 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h @@ -1,7 +1,7 @@ /** @file
Main file for NULL named library for Profile1 shell command functions.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -28,7 +28,6 @@ #include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePathToText.h>
#include <Protocol/DriverDiagnostics2.h>
#include <Protocol/DriverDiagnostics.h>
#include <Protocol/PlatformDriverOverride.h>
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c index 940f72d89a..4e1ac0da82 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Unload.c @@ -1,7 +1,7 @@ /** @file
Main file for Unload shell Driver1 function.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -67,7 +67,6 @@ DumpLoadedImageProtocolInfo ( {
EFI_LOADED_IMAGE_PROTOCOL *Image;
EFI_STATUS Status;
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToText;
CHAR16 *DevicePathText;
CHAR16 *CodeTypeText;
CHAR16 *DataTypeText;
@@ -79,23 +78,10 @@ DumpLoadedImageProtocolInfo ( if (EFI_ERROR(Status)) {
return (EFI_INVALID_PARAMETER);
}
-
- Status = gBS->LocateProtocol(
- &gEfiDevicePathToTextProtocolGuid,
- NULL,
- (VOID**)&DevicePathToText);
- //
- // we now have the device path to text protocol
- //
- if (!EFI_ERROR(Status)) {
- DevicePathText = DevicePathToText->ConvertDevicePathToText(Image->FilePath, TRUE, TRUE);
- } else {
- DevicePathText = NULL;
- }
-
- CodeTypeText = ConvertMemoryType(Image->ImageCodeType);
- DataTypeText = ConvertMemoryType(Image->ImageDataType);
- PdbPointer = (CHAR8*)PeCoffLoaderGetPdbPointer(Image->ImageBase);
+ DevicePathText = ConvertDevicePathToText(Image->FilePath, TRUE, TRUE);
+ CodeTypeText = ConvertMemoryType(Image->ImageCodeType);
+ DataTypeText = ConvertMemoryType(Image->ImageDataType);
+ PdbPointer = (CHAR8*)PeCoffLoaderGetPdbPointer(Image->ImageBase);
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_UNLOAD_VERBOSE), gShellDriver1HiiHandle,
ConvertHandleToHandleIndex(TheHandle),
TheHandle,
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c index 5dcbfb6950..390f1b6da9 100644 --- a/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c @@ -1050,7 +1050,7 @@ BcfgDisplayDumpInstall1( if ((*(UINT16*)(Buffer+4)) != 0) {
DevPath = AllocateZeroPool(*(UINT16*)(Buffer+4));
CopyMem(DevPath, Buffer+6+StrSize((CHAR16*)(Buffer+6)), *(UINT16*)(Buffer+4));
- DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE);
+ DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
} else {
DevPath = NULL;
DevPathString = NULL;
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h index 09207c0698..8b47a29a86 100644 --- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h @@ -1,7 +1,7 @@ /** @file
Main file for NULL named library for install 1 shell command functions.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -25,7 +25,6 @@ #include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePathToText.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h index b0ef503158..c4ef536202 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h @@ -1,7 +1,7 @@ /** @file
Main file for NULL named library for level 1 shell command functions.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -25,7 +25,6 @@ #include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePathToText.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c index 2725f4ad39..bd004beaaf 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c @@ -421,7 +421,7 @@ PerformSingleMappingDisplay( if (TempSpot != NULL) {
*TempSpot = CHAR_NULL;
}
- DevPathString = gDevPathToText->ConvertDevicePathToText(DevPath, TRUE, FALSE);
+ DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
if (!SFO) {
TempLen = StrLen(CurrentName);
ShellPrintHiiEx (
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h index 2018247573..8abf7e02a8 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h @@ -9,7 +9,7 @@ * functions are non-interactive only
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -33,7 +33,6 @@ #include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePathToText.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf index 5787c817f9..52844429ea 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf @@ -1,7 +1,7 @@ ## @file
# Provides shell level 2 functions
#
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -65,6 +65,7 @@ HiiLib
HandleParsingLib
PathLib
+ DevicePathLib
[Protocols]
gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED
@@ -73,7 +74,6 @@ gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED
gEfiLoadedImageProtocolGuid # ALWAYS_CONSUMED
gEfiSimpleFileSystemProtocolGuid # ALWAYS_CONSUMED
- gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED
[Pcd.common]
gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel # ALWAYS_CONSUMED
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h index 5636d497c0..bd5b9bec9c 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h @@ -25,7 +25,6 @@ #include <Protocol/DevicePath.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/UnicodeCollation.h>
-#include <Protocol/DevicePathToText.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
diff --git a/ShellPkg/Library/UefiSortLib/UefiSortLib.c b/ShellPkg/Library/UefiSortLib/UefiSortLib.c index 9cff46d4e6..2aab9d2691 100644 --- a/ShellPkg/Library/UefiSortLib/UefiSortLib.c +++ b/ShellPkg/Library/UefiSortLib/UefiSortLib.c @@ -17,7 +17,6 @@ #include <Protocol/UnicodeCollation.h>
#include <Protocol/DevicePath.h>
-#include <Protocol/DevicePathToText.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseLib.h>
@@ -25,8 +24,8 @@ #include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/SortLib.h>
+#include <Library/DevicePathLib.h>
-STATIC EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *mDevicePathToText = NULL;
STATIC EFI_UNICODE_COLLATION_PROTOCOL *mUnicodeCollation = NULL;
@@ -224,15 +223,6 @@ DevicePathCompare ( return 1;
}
- if (mDevicePathToText == NULL) {
- Status = gBS->LocateProtocol(
- &gEfiDevicePathToTextProtocolGuid,
- NULL,
- (VOID**)&mDevicePathToText);
-
- ASSERT_EFI_ERROR(Status);
- }
-
if (mUnicodeCollation == NULL) {
Status = gBS->LocateProtocol(
&gEfiUnicodeCollation2ProtocolGuid,
@@ -242,12 +232,12 @@ DevicePathCompare ( ASSERT_EFI_ERROR(Status);
}
- TextPath1 = mDevicePathToText->ConvertDevicePathToText(
+ TextPath1 = ConvertDevicePathToText(
DevicePath1,
FALSE,
FALSE);
- TextPath2 = mDevicePathToText->ConvertDevicePathToText(
+ TextPath2 = ConvertDevicePathToText(
DevicePath2,
FALSE,
FALSE);
diff --git a/ShellPkg/Library/UefiSortLib/UefiSortLib.inf b/ShellPkg/Library/UefiSortLib/UefiSortLib.inf index 8080cc0c82..31afb27920 100644 --- a/ShellPkg/Library/UefiSortLib/UefiSortLib.inf +++ b/ShellPkg/Library/UefiSortLib/UefiSortLib.inf @@ -1,7 +1,7 @@ ## @file
# Library used for sorting routines.
#
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
+# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved. <BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -38,9 +38,9 @@ BaseMemoryLib
DebugLib
UefiBootServicesTableLib
+ DevicePathLib
[Protocols]
gEfiUnicodeCollation2ProtocolGuid # ALWAYS_CONSUMED
gEfiDevicePathProtocolGuid # ALWAYS_CONSUMED
- gEfiDevicePathToTextProtocolGuid # ALWAYS_CONSUMED
diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index e0b258839b..3284c1cdc5 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -26,7 +26,7 @@ [LibraryClasses.common]
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf
DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
|