]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
Remove SafeFreePool from MemoryAllocationLib as this API's name is misleading. Its...
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / BootMaint / BootMaint.c
index 44b30d841e3a067b324dcb4f28dd0d2e3f41810f..ac313989874c0ee5020984eba0bebcdfe43b1d52 100644 (file)
@@ -25,12 +25,12 @@ EFI_DEVICE_PATH_PROTOCOL  EndDevicePath[] = {
 };\r
 \r
 \r
-EFI_GUID EfiLegacyDevOrderGuid = EFI_LEGACY_DEV_ORDER_VARIABLE_GUID;\r
-EFI_GUID mBootMaintGuid = BOOT_MAINT_FORMSET_GUID;\r
-EFI_GUID mFileExplorerGuid = FILE_EXPLORE_FORMSET_GUID;\r
+EFI_GUID EfiLegacyDevOrderGuid  = EFI_LEGACY_DEV_ORDER_VARIABLE_GUID;\r
+EFI_GUID mBootMaintGuid         = BOOT_MAINT_FORMSET_GUID;\r
+EFI_GUID mFileExplorerGuid      = FILE_EXPLORE_FORMSET_GUID;\r
 \r
-CHAR16  mBootMaintStorageName[] = L"BmData";\r
-CHAR16  mFileExplorerStorageName[] = L"FeData";\r
+CHAR16  mBootMaintStorageName[]     = L"BmData";\r
+CHAR16  mFileExplorerStorageName[]  = L"FeData";\r
 \r
 /**\r
   Init all memu.\r
@@ -102,14 +102,14 @@ CreateMenuStringToken (
   or more named elements from the target driver.\r
 \r
 \r
-  @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
-  @param Request         A null-terminated Unicode string in <ConfigRequest> format.\r
-  @param Progress        On return, points to a character in the Request string.\r
+  @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
+  @param Request         A null-terminated Unicode string in <ConfigRequest> format.\r
+  @param Progress        On return, points to a character in the Request string.\r
                          Points to the string's null terminator if request was successful.\r
                          Points to the most recent '&' before the first failing name/value\r
                          pair (or the beginning of the string if the failure is in the\r
                          first name/value pair) if the request was not successful.\r
-  @param Results         A null-terminated Unicode string in <ConfigAltResp> format which\r
+  @param Results         A null-terminated Unicode string in <ConfigAltResp> format which\r
                          has all values filled in for the names in the Request string.\r
                          String to be allocated by the called function.\r
 \r
@@ -540,10 +540,9 @@ BootMaintCallback (
 /**\r
   Function handling request to apply changes for BMM pages.\r
 \r
-\r
-  @param Private         - Pointer to callback data buffer.\r
-  @param CurrentFakeNVMap - Pointer to buffer holding data of various values used by BMM\r
-  @param FormId          - ID of the form which has sent the request to apply change.\r
+  @param Private            Pointer to callback data buffer.\r
+  @param CurrentFakeNVMap   Pointer to buffer holding data of various values used by BMM\r
+  @param FormId             ID of the form which has sent the request to apply change.\r
 \r
   @retval  EFI_SUCCESS       Change successfully applied.\r
   @retval  Other             Error occurs while trying to apply changes.\r
@@ -728,10 +727,8 @@ Error:
   Discard all changes done to the BMM pages such as Boot Order change,\r
   Driver order change.\r
 \r
-  @param Private         The BMM context data.\r
-  @param CurrentFakeNVMap The current Fack NV Map.\r
-\r
-  \r
+  @param Private            The BMM context data.\r
+  @param CurrentFakeNVMap   The current Fack NV Map.\r
 \r
 **/\r
 VOID\r
@@ -814,7 +811,7 @@ InitializeBM (
   //\r
   Ptr = AllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY));\r
   if (Ptr == NULL) {\r
-    SafeFreePool (BmmCallbackInfo);\r
+    FreePool (BmmCallbackInfo);\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
@@ -920,8 +917,8 @@ InitializeBM (
   gUpdateData.BufferSize = UPDATE_DATA_SIZE;\r
   gUpdateData.Data = AllocateZeroPool (UPDATE_DATA_SIZE);\r
   if (gUpdateData.Data == NULL) {\r
-    SafeFreePool (BmmCallbackInfo->LoadContext);\r
-    SafeFreePool (BmmCallbackInfo);\r
+    FreePool (BmmCallbackInfo->LoadContext);\r
+    FreePool (BmmCallbackInfo);\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
@@ -1023,9 +1020,9 @@ InitializeBM (
 \r
   FreeAllMenu ();\r
 \r
-  SafeFreePool (BmmCallbackInfo->LoadContext);\r
-  SafeFreePool (BmmCallbackInfo);\r
-  SafeFreePool (gUpdateData.Data);\r
+  FreePool (BmmCallbackInfo->LoadContext);\r
+  FreePool (BmmCallbackInfo);\r
+  FreePool (gUpdateData.Data);\r
   gUpdateData.Data = NULL;\r
 \r
   return Status;\r
@@ -1208,7 +1205,7 @@ CleanUpStringDepository (
     CurrentListNode = StringDepository->ListHead;\r
     for (NodeIndex = 0; NodeIndex < StringDepository->TotalNodeNumber; NodeIndex++) {\r
       NextListNode = CurrentListNode->Next;\r
-      SafeFreePool (CurrentListNode);\r
+      FreePool (CurrentListNode);\r
       CurrentListNode = NextListNode;\r
     }\r
 \r
@@ -1217,7 +1214,7 @@ CleanUpStringDepository (
   //\r
   // Release string depository.\r
   //\r
-  SafeFreePool (FileOptionStrDepository);\r
+  FreePool (FileOptionStrDepository);\r
 }\r
 \r
 /**\r
@@ -1252,21 +1249,11 @@ BdsStartBootMaint (
   //\r
   BdsLibEnumerateAllBootOption (&BdsBootOptionList);\r
 \r
-  //\r
-  // Drop the TPL level from TPL_APPLICATION to TPL_APPLICATION\r
-  //\r
-  gBS->RestoreTPL (TPL_APPLICATION);\r
-\r
   //\r
   // Init the BMM\r
   //\r
   Status = InitializeBM ();\r
 \r
-  //\r
-  // Raise the TPL level back to TPL_APPLICATION\r
-  //\r
-  gBS->RaiseTPL (TPL_APPLICATION);\r
-\r
   return Status;\r
 }\r
 \r