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>
/** @file\r
Provide Boot Manager related library APIs.\r
\r
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption\r
);\r
\r
+\r
+/**\r
+ Get the load option by its device path.\r
+\r
+ @param FilePath The device path pointing to a load option.\r
+ It could be a short-form device path.\r
+ @param FullPath Return the full device path of the load option after\r
+ short-form device path expanding.\r
+ Caller is responsible to free it.\r
+ @param FileSize Return the load option size.\r
+\r
+ @return The load option buffer. Caller is responsible to free the memory.\r
+**/\r
+VOID *\r
+EFIAPI\r
+EfiBootManagerGetLoadOptionBuffer (\r
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
+ OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,\r
+ OUT UINTN *FileSize\r
+ );\r
+\r
/**\r
The function enumerates all the legacy boot options, creates them and \r
registers them in the BootOrder variable.\r
\r
for (Index = 0; (Index < HandleCount) && (FileBuffer == NULL); Index++) {\r
FullDevicePath = AppendDevicePath (DevicePathFromHandle (Handles[Index]), RemainingDevicePath);\r
- FileBuffer = BmGetLoadOptionBuffer (FullDevicePath, FullPath, FileSize);\r
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (FullDevicePath, FullPath, FileSize);\r
FreePool (FullDevicePath);\r
}\r
\r
Status = EfiBootManagerConnectDevicePath (Instance, NULL);\r
if (!EFI_ERROR (Status)) {\r
TempDevicePath = AppendDevicePath (Instance, NextDevicePathNode (FilePath));\r
- FileBuffer = BmGetLoadOptionBuffer (TempDevicePath, FullPath, FileSize);\r
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (TempDevicePath, FullPath, FileSize);\r
FreePool (TempDevicePath);\r
\r
if (FileBuffer != NULL) {\r
// Find the matched partition device path\r
//\r
TempDevicePath = AppendDevicePath (BlockIoDevicePath, NextDevicePathNode (FilePath));\r
- FileBuffer = BmGetLoadOptionBuffer (TempDevicePath, FullPath, FileSize);\r
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (TempDevicePath, FullPath, FileSize);\r
FreePool (TempDevicePath);\r
\r
if (FileBuffer != NULL) {\r
@return The load option buffer. Caller is responsible to free the memory.\r
**/\r
VOID *\r
-BmGetLoadOptionBuffer (\r
+EFIAPI\r
+EfiBootManagerGetLoadOptionBuffer (\r
IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,\r
OUT UINTN *FileSize\r
RamDiskDevicePath = NULL;\r
if (DevicePathType (BootOption->FilePath) != BBS_DEVICE_PATH) {\r
Status = EFI_NOT_FOUND;\r
- FileBuffer = BmGetLoadOptionBuffer (BootOption->FilePath, &FilePath, &FileSize);\r
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (BootOption->FilePath, &FilePath, &FileSize);\r
if (FileBuffer != NULL) {\r
RamDiskDevicePath = BmGetRamDiskDevicePath (FilePath);\r
}\r
mBmLoadOptionName[LoadOption->OptionType], LoadOption->OptionNumber\r
));\r
ImageHandle = NULL;\r
- FileBuffer = BmGetLoadOptionBuffer (LoadOption->FilePath, &FilePath, &FileSize);\r
+ FileBuffer = EfiBootManagerGetLoadOptionBuffer (LoadOption->FilePath, &FilePath, &FileSize);\r
DEBUG_CODE (\r
if (FileBuffer != NULL && CompareMem (LoadOption->FilePath, FilePath, GetDevicePathSize (FilePath)) != 0) {\r
DEBUG ((EFI_D_INFO, "[Bds] DevicePath expand: "));\r
IN VOID *Data\r
);\r
\r
-/**\r
- Get the load option by its device path.\r
-\r
- @param FilePath The device path pointing to a load option.\r
- It could be a short-form device path.\r
- @param FullPath Return the full device path of the load option after\r
- short-form device path expanding.\r
- Caller is responsible to free it.\r
- @param FileSize Return the load option size.\r
-\r
- @return The load option buffer. Caller is responsible to free the memory.\r
-**/\r
-VOID *\r
-BmGetLoadOptionBuffer (\r
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
- OUT EFI_DEVICE_PATH_PROTOCOL **FullPath,\r
- OUT UINTN *FileSize\r
- );\r
-\r
/**\r
Return whether the PE header of the load option is valid or not.\r
\r