summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-04-21 13:28:31 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-05-04 08:47:34 +0800
commit4ed2440d44152939adc88fcc07b8f5240db596a5 (patch)
tree978e3e0ec04875c013af346e55dc7266c807fbec
parentd0a23f9f86dc39065429dc954adbc56b099b801e (diff)
downloadedk2-platforms-4ed2440d44152939adc88fcc07b8f5240db596a5.tar.xz
MdeModulePkg/UefiBootManagerLib: Expose *GetLoadOptionBuffer() API
Expose EfiBootManagerGetLoadOptionBuffer() API. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
-rw-r--r--MdeModulePkg/Include/Library/UefiBootManagerLib.h23
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c11
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c2
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h19
4 files changed, 29 insertions, 26 deletions
diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
index 91926fc638..0fdb23dcbd 100644
--- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
@@ -1,7 +1,7 @@
/** @file
Provide Boot Manager related library APIs.
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -431,6 +431,27 @@ EfiBootManagerGetBootManagerMenu (
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption
);
+
+/**
+ Get the load option by its device path.
+
+ @param FilePath The device path pointing to a load option.
+ It could be a short-form device path.
+ @param FullPath Return the full device path of the load option after
+ short-form device path expanding.
+ Caller is responsible to free it.
+ @param FileSize Return the load option size.
+
+ @return The load option buffer. Caller is responsible to free the memory.
+**/
+VOID *
+EFIAPI
+EfiBootManagerGetLoadOptionBuffer (
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,
+ OUT UINTN *FileSize
+ );
+
/**
The function enumerates all the legacy boot options, creates them and
registers them in the BootOrder variable.
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index beb2eafe29..d016517014 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -586,7 +586,7 @@ BmExpandUsbDevicePath (
for (Index = 0; (Index < HandleCount) && (FileBuffer == NULL); Index++) {
FullDevicePath = AppendDevicePath (DevicePathFromHandle (Handles[Index]), RemainingDevicePath);
- FileBuffer = BmGetLoadOptionBuffer (FullDevicePath, FullPath, FileSize);
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (FullDevicePath, FullPath, FileSize);
FreePool (FullDevicePath);
}
@@ -851,7 +851,7 @@ BmExpandPartitionDevicePath (
Status = EfiBootManagerConnectDevicePath (Instance, NULL);
if (!EFI_ERROR (Status)) {
TempDevicePath = AppendDevicePath (Instance, NextDevicePathNode (FilePath));
- FileBuffer = BmGetLoadOptionBuffer (TempDevicePath, FullPath, FileSize);
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (TempDevicePath, FullPath, FileSize);
FreePool (TempDevicePath);
if (FileBuffer != NULL) {
@@ -911,7 +911,7 @@ BmExpandPartitionDevicePath (
// Find the matched partition device path
//
TempDevicePath = AppendDevicePath (BlockIoDevicePath, NextDevicePathNode (FilePath));
- FileBuffer = BmGetLoadOptionBuffer (TempDevicePath, FullPath, FileSize);
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (TempDevicePath, FullPath, FileSize);
FreePool (TempDevicePath);
if (FileBuffer != NULL) {
@@ -1425,7 +1425,8 @@ BmGetFileBufferFromLoadFiles (
@return The load option buffer. Caller is responsible to free the memory.
**/
VOID *
-BmGetLoadOptionBuffer (
+EFIAPI
+EfiBootManagerGetLoadOptionBuffer (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,
OUT UINTN *FileSize
@@ -1648,7 +1649,7 @@ EfiBootManagerBoot (
RamDiskDevicePath = NULL;
if (DevicePathType (BootOption->FilePath) != BBS_DEVICE_PATH) {
Status = EFI_NOT_FOUND;
- FileBuffer = BmGetLoadOptionBuffer (BootOption->FilePath, &FilePath, &FileSize);
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (BootOption->FilePath, &FilePath, &FileSize);
if (FileBuffer != NULL) {
RamDiskDevicePath = BmGetRamDiskDevicePath (FilePath);
}
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
index 8201255484..9af98de0af 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
@@ -1281,7 +1281,7 @@ EfiBootManagerProcessLoadOption (
mBmLoadOptionName[LoadOption->OptionType], LoadOption->OptionNumber
));
ImageHandle = NULL;
- FileBuffer = BmGetLoadOptionBuffer (LoadOption->FilePath, &FilePath, &FileSize);
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (LoadOption->FilePath, &FilePath, &FileSize);
DEBUG_CODE (
if (FileBuffer != NULL && CompareMem (LoadOption->FilePath, FilePath, GetDevicePathSize (FilePath)) != 0) {
DEBUG ((EFI_D_INFO, "[Bds] DevicePath expand: "));
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
index 7466719194..e1c5a96947 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
+++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
@@ -311,25 +311,6 @@ BmSetVariableAndReportStatusCodeOnError (
);
/**
- Get the load option by its device path.
-
- @param FilePath The device path pointing to a load option.
- It could be a short-form device path.
- @param FullPath Return the full device path of the load option after
- short-form device path expanding.
- Caller is responsible to free it.
- @param FileSize Return the load option size.
-
- @return The load option buffer. Caller is responsible to free the memory.
-**/
-VOID *
-BmGetLoadOptionBuffer (
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
- OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,
- OUT UINTN *FileSize
- );
-
-/**
Return whether the PE header of the load option is valid or not.
@param[in] Type The load option type.