summaryrefslogtreecommitdiff
path: root/OvmfPkg/Library/PlatformBdsLib
diff options
context:
space:
mode:
Diffstat (limited to 'OvmfPkg/Library/PlatformBdsLib')
-rw-r--r--OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c52
-rw-r--r--OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.c32
2 files changed, 38 insertions, 46 deletions
diff --git a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
index 781b415178..ba6af2caef 100644
--- a/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
@@ -1,7 +1,7 @@
/** @file
Platform BDS customizations.
- Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2004 - 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
@@ -209,14 +209,16 @@ Returns:
// Print Device Path
//
DevPathStr = DevicePathToStr(DevicePath);
- DEBUG((
- EFI_D_INFO,
- "BdsPlatform.c+%d: COM%d DevPath: %s\n",
- __LINE__,
- gPnp16550ComPortDeviceNode.UID + 1,
- DevPathStr
- ));
- FreePool(DevPathStr);
+ if (DevPathStr != NULL) {
+ DEBUG((
+ EFI_D_INFO,
+ "BdsPlatform.c+%d: COM%d DevPath: %s\n",
+ __LINE__,
+ gPnp16550ComPortDeviceNode.UID + 1,
+ DevPathStr
+ ));
+ FreePool(DevPathStr);
+ }
BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL);
BdsLibUpdateConsoleVariable (VarConsoleInp, DevicePath, NULL);
@@ -236,14 +238,16 @@ Returns:
// Print Device Path
//
DevPathStr = DevicePathToStr(DevicePath);
- DEBUG((
- EFI_D_INFO,
- "BdsPlatform.c+%d: COM%d DevPath: %s\n",
- __LINE__,
- gPnp16550ComPortDeviceNode.UID + 1,
- DevPathStr
- ));
- FreePool(DevPathStr);
+ if (DevPathStr != NULL) {
+ DEBUG((
+ EFI_D_INFO,
+ "BdsPlatform.c+%d: COM%d DevPath: %s\n",
+ __LINE__,
+ gPnp16550ComPortDeviceNode.UID + 1,
+ DevPathStr
+ ));
+ FreePool(DevPathStr);
+ }
BdsLibUpdateConsoleVariable (VarConsoleOut, DevicePath, NULL);
BdsLibUpdateConsoleVariable (VarConsoleInp, DevicePath, NULL);
@@ -799,12 +803,14 @@ ConnectRecursivelyIfPciMassStorage (
// Print Device Path
//
DevPathStr = DevicePathToStr (DevicePath);
- DEBUG((
- EFI_D_INFO,
- "Found Mass Storage device: %s\n",
- DevPathStr
- ));
- FreePool(DevPathStr);
+ if (DevPathStr != NULL) {
+ DEBUG((
+ EFI_D_INFO,
+ "Found Mass Storage device: %s\n",
+ DevPathStr
+ ));
+ FreePool(DevPathStr);
+ }
Status = gBS->ConnectController (Handle, NULL, NULL, TRUE);
if (EFI_ERROR (Status)) {
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
)
) {
//