]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Make the BmFindLoadOption function public
authorSunny Wang <sunnywang@hpe.com>
Mon, 26 Oct 2015 04:49:08 +0000 (04:49 +0000)
committerniruiyu <niruiyu@Edk2>
Mon, 26 Oct 2015 04:49:08 +0000 (04:49 +0000)
Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18662 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Library/UefiBootManagerLib.h
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h

index 5538d9073874f7966a679d9c7c14233174f85ffd..54a67130f315cfe261a182871284dc3da34346ee 100644 (file)
@@ -2,6 +2,7 @@
   Provide Boot Manager related library APIs.\r
 \r
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2015 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
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -222,6 +223,27 @@ EfiBootManagerSortLoadOptionVariable (
   IN SORT_COMPARE                      CompareFunction\r
   );\r
 \r
+/**\r
+  Return the index of the load option in the load option array.\r
+\r
+  The function consider two load options are equal when the \r
+  OptionType, Attributes, Description, FilePath and OptionalData are equal.\r
+\r
+  @param Key    Pointer to the load option to be found.\r
+  @param Array  Pointer to the array of load options to be found.\r
+  @param Count  Number of entries in the Array.\r
+\r
+  @retval -1          Key wasn't found in the Array.\r
+  @retval 0 ~ Count-1 The index of the Key in the Array.\r
+**/\r
+INTN\r
+EFIAPI\r
+EfiBootManagerFindLoadOption (\r
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,\r
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,\r
+  IN UINTN                              Count\r
+  );\r
+\r
 //\r
 // Boot Manager hot key library functions.\r
 //\r
index 8f14cf6d3f8116a6c7b44206757b4363e7a33231..aef2e7bbdcb1438397c85a4ad2c83ac18e692563 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Library functions which relates with booting.\r
 \r
-(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2015 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
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -206,7 +206,7 @@ BmFindBootOptionInVariable (
   if (OptionNumber == LoadOptionNumberUnassigned) {\r
     BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);\r
 \r
-    Index = BmFindLoadOption (OptionToFind, BootOptions, BootOptionCount);\r
+    Index = EfiBootManagerFindLoadOption (OptionToFind, BootOptions, BootOptionCount);\r
     if (Index != -1) {\r
       OptionNumber = BootOptions[Index].OptionNumber;\r
     }\r
@@ -2165,7 +2165,7 @@ EfiBootManagerRefreshAllBootOption (
       // Only check those added by BDS\r
       // so that the boot options added by end-user or OS installer won't be deleted\r
       //\r
-      if (BmFindLoadOption (&NvBootOptions[Index], BootOptions, BootOptionCount) == (UINTN) -1) {\r
+      if (EfiBootManagerFindLoadOption (&NvBootOptions[Index], BootOptions, BootOptionCount) == (UINTN) -1) {\r
         Status = EfiBootManagerDeleteLoadOptionVariable (NvBootOptions[Index].OptionNumber, LoadOptionTypeBoot);\r
         //\r
         // Deleting variable with current variable implementation shouldn't fail.\r
@@ -2179,7 +2179,7 @@ EfiBootManagerRefreshAllBootOption (
   // Add new EFI boot options to NV\r
   //\r
   for (Index = 0; Index < BootOptionCount; Index++) {\r
-    if (BmFindLoadOption (&BootOptions[Index], NvBootOptions, NvBootOptionCount) == (UINTN) -1) {\r
+    if (EfiBootManagerFindLoadOption (&BootOptions[Index], NvBootOptions, NvBootOptionCount) == (UINTN) -1) {\r
       EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN) -1);\r
       //\r
       // Try best to add the boot options so continue upon failure.\r
@@ -2260,7 +2260,7 @@ BmRegisterBootManagerMenu (
     UINTN                           BootOptionCount;\r
 \r
     BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOptionTypeBoot);\r
-    ASSERT (BmFindLoadOption (BootOption, BootOptions, BootOptionCount) == -1);\r
+    ASSERT (EfiBootManagerFindLoadOption (BootOption, BootOptions, BootOptionCount) == -1);\r
     EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);\r
     );\r
 \r
index 6b9690a37c2d8fb96ec69aaaecd4b28ba7c68f29..07c337639225fbe7163dcb7e0bf3178cfb6488c7 100644 (file)
@@ -2,6 +2,7 @@
   Load option library functions which relate with creating and processing load options.\r
 \r
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2015 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
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -504,7 +505,8 @@ EfiBootManagerInitializeLoadOption (
   @retval 0 ~ Count-1 The index of the Key in the Array.\r
 **/\r
 INTN\r
-BmFindLoadOption (\r
+EFIAPI\r
+EfiBootManagerFindLoadOption (\r
   IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,\r
   IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,\r
   IN UINTN                              Count\r
index d415442e23991799b62c906eac14b10727c3a9fe..5af7f3ba9f31d12ca7d6e09f620c43edaceb38de 100644 (file)
@@ -2,6 +2,7 @@
   BDS library definition, include the file and data structure\r
 \r
 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2015 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
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -407,27 +408,6 @@ BmDelPartMatchInstance (
   IN     EFI_DEVICE_PATH_PROTOCOL  *Single\r
   );\r
 \r
-\r
-/**\r
-  Return the index of the load option in the load option array.\r
-\r
-  The function consider two load options are equal when the \r
-  OptionType, Attributes, Description, FilePath and OptionalData are equal.\r
-\r
-  @param Key    Pointer to the load option to be found.\r
-  @param Array  Pointer to the array of load options to be found.\r
-  @param Count  Number of entries in the Array.\r
-\r
-  @retval -1          Key wasn't found in the Array.\r
-  @retval 0 ~ Count-1 The index of the Key in the Array.\r
-**/\r
-INTN\r
-BmFindLoadOption (\r
-  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,\r
-  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,\r
-  IN UINTN                              Count\r
-  );\r
-\r
 /**\r
   Repair all the controllers according to the Driver Health status queried.\r
 **/\r