]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UefiBootManagerLib: Expose *GetLoadOptionBuffer() API
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 21 Apr 2016 05:28:31 +0000 (13:28 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 4 May 2016 00:47:34 +0000 (08:47 +0800)
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>
MdeModulePkg/Include/Library/UefiBootManagerLib.h
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h

index 91926fc638f921484cdb3fcd76ad4ab9c4495097..0fdb23dcbdba9e60dac99b598c6cbf1c394603af 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
@@ -431,6 +431,27 @@ EfiBootManagerGetBootManagerMenu (
   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
index beb2eafe2943af2c8a0f32169d4ab61647b394d7..d0165170143f07ee557e9115dd99e0753f43b1aa 100644 (file)
@@ -586,7 +586,7 @@ BmExpandUsbDevicePath (
 \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
@@ -851,7 +851,7 @@ BmExpandPartitionDevicePath (
         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
@@ -911,7 +911,7 @@ BmExpandPartitionDevicePath (
       // 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
@@ -1425,7 +1425,8 @@ BmGetFileBufferFromLoadFiles (
   @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
@@ -1648,7 +1649,7 @@ EfiBootManagerBoot (
   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
index 8201255484cf4a5c1e8403a121bdf74c61e64f9a..9af98de0afaf9097b57d5ffacdf89ab9d14f25f2 100644 (file)
@@ -1281,7 +1281,7 @@ EfiBootManagerProcessLoadOption (
     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
index 746671919457d96df2ad5d3e4433963d0860a440..e1c5a96947178023eb59bfc3cd480a11fc65bfe2 100644 (file)
@@ -310,25 +310,6 @@ BmSetVariableAndReportStatusCodeOnError (
   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