summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2013-07-26 03:14:08 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2013-07-26 03:14:08 +0000
commit863986b3c8e67736d361b68e293d01e6f92f825c (patch)
tree15cf067d949655c9defeeeaa78eeea6050845b64 /OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
parent4d0a30a494599226450bf69ad9d6fc689f61712e (diff)
downloadedk2-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 'OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c')
-rw-r--r--OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
index 9f94e2424a..c9b8556fab 100644
--- a/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
+++ b/OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c
@@ -1,7 +1,7 @@
/** @file
Rewrite the BootOrder NvVar based on QEMU's "bootorder" fw_cfg file.
- Copyright (C) 2012, Red Hat, Inc.
+ Copyright (C) 2012 - 2013, Red Hat, Inc.
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -20,7 +20,7 @@
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/PrintLib.h>
-#include <Protocol/DevicePathToText.h>
+#include <Library/DevicePathLib.h>
#include <Guid/GlobalVariable.h>
@@ -866,18 +866,17 @@ BOOLEAN
Match (
IN CONST CHAR16 *Translated,
IN UINTN TranslatedLength,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
- IN CONST EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
{
CHAR16 *Converted;
BOOLEAN Result;
- Converted = DevPathToText->ConvertDevicePathToText (
- DevicePath,
- FALSE, // DisplayOnly
- FALSE // AllowShortcuts
- );
+ Converted = ConvertDevicePathToText (
+ DevicePath,
+ FALSE, // DisplayOnly
+ FALSE // AllowShortcuts
+ );
if (Converted == NULL) {
return FALSE;
}
@@ -933,9 +932,6 @@ SetBootOrderFromQemu (
)
{
RETURN_STATUS Status;
-
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
-
FIRMWARE_CONFIG_ITEM FwCfgItem;
UINTN FwCfgSize;
CHAR8 *FwCfg;
@@ -946,15 +942,6 @@ SetBootOrderFromQemu (
UINTN TranslatedSize;
CHAR16 Translated[TRANSLATION_OUTPUT_SIZE];
- Status = gBS->LocateProtocol (
- &gEfiDevicePathToTextProtocolGuid,
- NULL, // optional registration key
- (VOID **) &DevPathToText
- );
- if (Status != EFI_SUCCESS) {
- return Status;
- }
-
Status = QemuFwCfgFindFile ("bootorder", &FwCfgItem, &FwCfgSize);
if (Status != RETURN_SUCCESS) {
return Status;
@@ -1019,8 +1006,7 @@ SetBootOrderFromQemu (
Match (
Translated,
TranslatedSize, // contains length, not size, in CHAR16's here
- BootOption->DevicePath,
- DevPathToText
+ BootOption->DevicePath
)
) {
//