]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Mem/Page.c
Apply HighBitSet() in MDE baseLib to retire the internal function CoreHighestSetBit().
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Mem / Page.c
index 3159fbd3b36a499dc0d4756864eda79f3329efc6..aeaa48da80f4357bec5b1b9cf99fd5856518fb53 100644 (file)
@@ -12,12 +12,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <DxeMain.h>\r
+#include "DxeMain.h"\r
 \r
 #define EFI_DEFAULT_PAGE_ALLOCATION_ALIGNMENT  (EFI_PAGE_SIZE)\r
 \r
 //\r
-// Entry for tracking the memory regions for each memory type to help cooalese like memory types\r
+// Entry for tracking the memory regions for each memory type to coalesce similar memory types\r
 //\r
 typedef struct {\r
   EFI_PHYSICAL_ADDRESS  BaseAddress;\r
@@ -221,7 +221,7 @@ PromoteMemoryResource (
   LIST_ENTRY                       *Link;\r
   EFI_GCD_MAP_ENTRY                *Entry;\r
 \r
-  DEBUG ((DEBUG_ERROR | DEBUG_PAGE, "Promote the memory resource\n"));\r
+  DEBUG ((DEBUG_PAGE, "Promote the memory resource\n"));\r
 \r
   CoreAcquireGcdMemoryLock ();\r
 \r
@@ -754,7 +754,7 @@ CoreConvertPages (
     // Debug code - verify conversion is allowed\r
     //\r
     if (!(NewType == EfiConventionalMemory ? 1 : 0) ^ (Entry->Type == EfiConventionalMemory ? 1 : 0)) {\r
-      DEBUG ((DEBUG_ERROR , "ConvertPages: Incompatible memory types\n"));\r
+      DEBUG ((DEBUG_ERROR | DEBUG_PAGE, "ConvertPages: Incompatible memory types\n"));\r
       return EFI_NOT_FOUND;\r
     }\r
 \r
@@ -1516,19 +1516,19 @@ CoreTerminateMemoryMap (
       Entry = CR(Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);\r
       if (Entry->Attribute & EFI_MEMORY_RUNTIME) {\r
         if (Entry->Type == EfiACPIReclaimMemory || Entry->Type == EfiACPIMemoryNVS) {\r
-          DEBUG((DEBUG_ERROR, "ExitBootServices: ACPI memory entry has RUNTIME attribute set.\n"));\r
-          CoreReleaseMemoryLock ();\r
-          return EFI_INVALID_PARAMETER;\r
+          DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: ACPI memory entry has RUNTIME attribute set.\n"));\r
+          Status =  EFI_INVALID_PARAMETER;\r
+          goto Done;\r
         }\r
         if (Entry->Start & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) {\r
-          DEBUG((DEBUG_ERROR, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));\r
-          CoreReleaseMemoryLock ();\r
-          return EFI_INVALID_PARAMETER;\r
+          DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));\r
+          Status =  EFI_INVALID_PARAMETER;\r
+          goto Done;\r
         }\r
         if ((Entry->End + 1) & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) {\r
-          DEBUG((DEBUG_ERROR, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));\r
-          CoreReleaseMemoryLock ();\r
-          return EFI_INVALID_PARAMETER;\r
+          DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));\r
+          Status =  EFI_INVALID_PARAMETER;\r
+          goto Done;\r
         }\r
       }\r
     }\r
@@ -1544,6 +1544,7 @@ CoreTerminateMemoryMap (
     Status = EFI_INVALID_PARAMETER;\r
   }\r
 \r
+Done:\r
   CoreReleaseMemoryLock ();\r
 \r
   return Status;\r