summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-24 15:52:09 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2009-02-24 15:52:09 +0000
commit87fbccbe40e5079394b1a3fc610b40c3d641815c (patch)
treeb428b0a4cdbe12cf0fd11f18ca3e18e8a199ea23 /MdeModulePkg/Application
parent2743172515f8a76b3dd9bb22a0be327f3d217e0a (diff)
downloadedk2-platforms-87fbccbe40e5079394b1a3fc610b40c3d641815c.tar.xz
Move library class GenericBdsLib and PlatformBdsLib to IntelFrameworkModulePkg
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7655 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c61
-rw-r--r--MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf3
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