diff options
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r-- | MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c | 61 | ||||
-rw-r--r-- | MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf | 3 |
2 files changed, 61 insertions, 3 deletions
diff --git a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c b/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c index 3711a9193e..c46ff8d4c0 100644 --- a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c +++ b/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c @@ -36,6 +36,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Protocol/ComponentName2.h>
#include <Protocol/ComponentName.h>
#include <Protocol/DriverBinding.h>
+#include <Protocol/DevicePathToText.h>
#include <Guid/GlobalVariable.h>
#include <Library/BaseLib.h>
@@ -52,7 +53,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/MemoryAllocationLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/DevicePathLib.h>
-#include <Library/GenericBdsLib.h>
#include "PlatOverMngr.h"
#define EFI_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('C', 'l', 'b', 'k')
@@ -95,6 +95,22 @@ CHAR8 mLanguage[RFC_3066_ENTRY_SIZE]; UINT16 mCurrentPage;
/**
+ Converting a given device to an unicode string.
+
+ This function will dependent on gEfiDevicePathToTextProtocolGuid, if protocol
+ does not installed, then return unknown device path L"?" directly.
+
+ @param DevPath Given device path instance
+
+ @return Converted string from given device path.
+ @retval L"?" Can not locate gEfiDevicePathToTextProtocolGuid protocol for converting.
+**/
+CHAR16 *
+DevicePathToStr (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevPath
+ );
+
+/**
Do string convertion for the ComponentName supported language. It do
the convertion just for english language code from RFC 3066 to ISO 639-2.
Then it will check whether the converted language is in the supported language list.
@@ -1439,3 +1455,46 @@ Finish: return Status;
}
+
+/**
+ Converting a given device to an unicode string.
+
+ This function will dependent on gEfiDevicePathToTextProtocolGuid, if protocol
+ does not installed, then return unknown device path L"?" directly.
+
+ @param DevPath Given device path instance
+
+ @return Converted string from given device path.
+ @retval L"?" Can not locate gEfiDevicePathToTextProtocolGuid protocol for converting.
+**/
+CHAR16 *
+DevicePathToStr (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevPath
+ )
+{
+ EFI_STATUS Status;
+ EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
+ CHAR16 *ToText;
+
+ if (DevPath == NULL) {
+ return L"";
+ }
+
+ Status = gBS->LocateProtocol (
+ &gEfiDevicePathToTextProtocolGuid,
+ NULL,
+ (VOID **) &DevPathToText
+ );
+ if (!EFI_ERROR (Status)) {
+ ToText = DevPathToText->ConvertDevicePathToText (
+ DevPath,
+ FALSE,
+ TRUE
+ );
+ ASSERT (ToText != NULL);
+ return ToText;
+ }
+
+ return L"?";
+}
+
\ No newline at end of file diff --git a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf b/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf index e8e3487b3e..f867ba3350 100644 --- a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf +++ b/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf @@ -64,7 +64,6 @@ MemoryAllocationLib
UefiRuntimeServicesTableLib
DevicePathLib
- GenericBdsLib
[Guids]
gEfiGlobalVariableGuid ## CONSUMED ## Variable:L"PlatformLang" this variable specifies the platform supported language string (RFC 3066 format)
@@ -85,4 +84,4 @@ gEfiFormBrowser2ProtocolGuid ## CONSUMED
gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
gEfiHiiConfigAccessProtocolGuid ## PRODUCED
-
\ No newline at end of file + gEfiDevicePathToTextProtocolGuid ## CONSUMED
\ No newline at end of file |