]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
MdePkg: Add Platform Recovery definitions.
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmLoadOption.c
index 2a42a7d354d048251c665a4757142611a389d26f..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
@@ -100,6 +101,8 @@ BmGetFreeOptionNumber (
           LoadOptionType == LoadOptionTypeSysPrep);\r
 \r
   GetEfiGlobalVariable2 (mBmLoadOptionOrderName[LoadOptionType], (VOID **) &OptionOrder, &OptionOrderSize);\r
+  ASSERT ((OptionOrder != NULL && OptionOrderSize != 0) || (OptionOrder == NULL && OptionOrderSize == 0));\r
+\r
   BootNext = NULL;\r
   if (LoadOptionType == LoadOptionTypeBoot) {\r
     GetEfiGlobalVariable2 (L"BootNext", (VOID**) &BootNext, NULL);\r
@@ -268,6 +271,7 @@ BmAddOptionNumberToOrderVariable (
   // Update the option order variable\r
   //\r
   GetEfiGlobalVariable2 (OptionOrderName, (VOID **) &OptionOrder, &OptionOrderSize);\r
+  ASSERT ((OptionOrder != NULL && OptionOrderSize != 0) || (OptionOrder == NULL && OptionOrderSize == 0));\r
 \r
   Status = EFI_SUCCESS;\r
   for (Index = 0; Index < OptionOrderSize / sizeof (UINT16); Index++) {\r
@@ -501,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
@@ -557,6 +562,8 @@ EfiBootManagerDeleteLoadOptionVariable (
     // If the associated *Order exists, just remove the reference in *Order.\r
     //\r
     GetEfiGlobalVariable2 (mBmLoadOptionOrderName[OptionType], (VOID **) &OptionOrder, &OptionOrderSize);\r
+    ASSERT ((OptionOrder != NULL && OptionOrderSize != 0) || (OptionOrder == NULL && OptionOrderSize == 0));\r
+\r
     for (Index = 0; Index < OptionOrderSize / sizeof (UINT16); Index++) {\r
       if (OptionOrder[Index] == OptionNumber) {\r
         OptionOrderSize -= sizeof (UINT16);\r