Revision: 18662
          http://sourceforge.net/p/edk2/code/18662
Author:   niruiyu
Date:     2015-10-26 04:49:08 +0000 (Mon, 26 Oct 2015)
Log Message:
-----------
MdeModulePkg: Make the BmFindLoadOption function public

Make the BmFindLoadOption function public

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Sunny Wang <[email protected]>
Reviewed-by: Samer El-Haj-Mahmoud <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Include/Library/UefiBootManagerLib.h
    trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
    trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
    trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h

Modified: trunk/edk2/MdeModulePkg/Include/Library/UefiBootManagerLib.h
===================================================================
--- trunk/edk2/MdeModulePkg/Include/Library/UefiBootManagerLib.h        
2015-10-26 03:26:55 UTC (rev 18661)
+++ trunk/edk2/MdeModulePkg/Include/Library/UefiBootManagerLib.h        
2015-10-26 04:49:08 UTC (rev 18662)
@@ -2,6 +2,7 @@
   Provide Boot Manager related library APIs.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 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
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -222,6 +223,27 @@
   IN SORT_COMPARE                      CompareFunction
   );
 
+/**
+  Return the index of the load option in the load option array.
+
+  The function consider two load options are equal when the 
+  OptionType, Attributes, Description, FilePath and OptionalData are equal.
+
+  @param Key    Pointer to the load option to be found.
+  @param Array  Pointer to the array of load options to be found.
+  @param Count  Number of entries in the Array.
+
+  @retval -1          Key wasn't found in the Array.
+  @retval 0 ~ Count-1 The index of the Key in the Array.
+**/
+INTN
+EFIAPI
+EfiBootManagerFindLoadOption (
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
+  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
+  IN UINTN                              Count
+  );
+
 //
 // Boot Manager hot key library functions.
 //

Modified: trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
===================================================================
--- trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 2015-10-26 
03:26:55 UTC (rev 18661)
+++ trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c 2015-10-26 
04:49:08 UTC (rev 18662)
@@ -1,8 +1,8 @@
 /** @file
   Library functions which relates with booting.
 
-(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 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
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -206,7 +206,7 @@
   if (OptionNumber == LoadOptionNumberUnassigned) {
     BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, 
LoadOptionTypeBoot);
 
-    Index = BmFindLoadOption (OptionToFind, BootOptions, BootOptionCount);
+    Index = EfiBootManagerFindLoadOption (OptionToFind, BootOptions, 
BootOptionCount);
     if (Index != -1) {
       OptionNumber = BootOptions[Index].OptionNumber;
     }
@@ -2165,7 +2165,7 @@
       // Only check those added by BDS
       // so that the boot options added by end-user or OS installer won't be 
deleted
       //
-      if (BmFindLoadOption (&NvBootOptions[Index], BootOptions, 
BootOptionCount) == (UINTN) -1) {
+      if (EfiBootManagerFindLoadOption (&NvBootOptions[Index], BootOptions, 
BootOptionCount) == (UINTN) -1) {
         Status = EfiBootManagerDeleteLoadOptionVariable 
(NvBootOptions[Index].OptionNumber, LoadOptionTypeBoot);
         //
         // Deleting variable with current variable implementation shouldn't 
fail.
@@ -2179,7 +2179,7 @@
   // Add new EFI boot options to NV
   //
   for (Index = 0; Index < BootOptionCount; Index++) {
-    if (BmFindLoadOption (&BootOptions[Index], NvBootOptions, 
NvBootOptionCount) == (UINTN) -1) {
+    if (EfiBootManagerFindLoadOption (&BootOptions[Index], NvBootOptions, 
NvBootOptionCount) == (UINTN) -1) {
       EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN) -1);
       //
       // Try best to add the boot options so continue upon failure.
@@ -2260,7 +2260,7 @@
     UINTN                           BootOptionCount;
 
     BootOptions = EfiBootManagerGetLoadOptions (&BootOptionCount, 
LoadOptionTypeBoot);
-    ASSERT (BmFindLoadOption (BootOption, BootOptions, BootOptionCount) == -1);
+    ASSERT (EfiBootManagerFindLoadOption (BootOption, BootOptions, 
BootOptionCount) == -1);
     EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
     );
 

Modified: trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
===================================================================
--- trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c   
2015-10-26 03:26:55 UTC (rev 18661)
+++ trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c   
2015-10-26 04:49:08 UTC (rev 18662)
@@ -2,6 +2,7 @@
   Load option library functions which relate with creating and processing load 
options.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 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
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -504,7 +505,8 @@
   @retval 0 ~ Count-1 The index of the Key in the Array.
 **/
 INTN
-BmFindLoadOption (
+EFIAPI
+EfiBootManagerFindLoadOption (
   IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
   IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
   IN UINTN                              Count

Modified: trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
===================================================================
--- trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h     
2015-10-26 03:26:55 UTC (rev 18661)
+++ trunk/edk2/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h     
2015-10-26 04:49:08 UTC (rev 18662)
@@ -2,6 +2,7 @@
   BDS library definition, include the file and data structure
 
 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+(C) Copyright 2015 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
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -407,28 +408,7 @@
   IN     EFI_DEVICE_PATH_PROTOCOL  *Single
   );
 
-
 /**
-  Return the index of the load option in the load option array.
-
-  The function consider two load options are equal when the 
-  OptionType, Attributes, Description, FilePath and OptionalData are equal.
-
-  @param Key    Pointer to the load option to be found.
-  @param Array  Pointer to the array of load options to be found.
-  @param Count  Number of entries in the Array.
-
-  @retval -1          Key wasn't found in the Array.
-  @retval 0 ~ Count-1 The index of the Key in the Array.
-**/
-INTN
-BmFindLoadOption (
-  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key,
-  IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array,
-  IN UINTN                              Count
-  );
-
-/**
   Repair all the controllers according to the Driver Health status queried.
 **/
 VOID


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to