]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Mem/Imem.h
MdeModulePkg DxeCore: Fix double free pages on LoadImage failure path
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Mem / Imem.h
index 7f906832182de60abe3e855132e6e8243fa16a3c..fb53f95575f07b5109f2a6ead9ec330b4c62109a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Data structure and functions to allocate and free memory space.\r
 \r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<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
@@ -15,36 +15,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _IMEM_H_\r
 #define _IMEM_H_\r
 \r
-#if defined (MDE_CPU_IPF)\r
-///\r
-/// For Itanium machines make the default allocations 8K aligned\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (EFI_PAGE_SIZE * 2)\r
-#define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE * 2)\r
-\r
-#elif defined (MDE_CPU_AARCH64)\r
-///\r
-/// 64-bit ARM systems allow the OS to execute with 64 KB page size,\r
-/// so for improved interoperability with the firmware, align the\r
-/// runtime regions to 64 KB as well\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (SIZE_64KB)\r
-#define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE)\r
-\r
-#else\r
-///\r
-/// For genric EFI machines make the default allocations 4K aligned\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (EFI_PAGE_SIZE)\r
-#define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE)\r
-\r
-#endif\r
-\r
 //\r
 // +---------------------------------------------------+\r
 // | 0..(EfiMaxMemoryType - 1)    - Normal memory type |\r
 // +---------------------------------------------------+\r
-// | EfiMaxMemoryType..0x6FFFFFFF - Ilegal             |\r
+// | EfiMaxMemoryType..0x6FFFFFFF - Invalid            |\r
 // +---------------------------------------------------+\r
 // | 0x70000000..0x7FFFFFFF       - OEM reserved       |\r
 // +---------------------------------------------------+\r
@@ -137,6 +112,7 @@ CoreAllocatePoolI (
   Caller must have the memory lock held\r
 \r
   @param  Buffer                 The allocated pool entry to free\r
+  @param  PoolType               Pointer to pool type\r
 \r
   @retval EFI_INVALID_PARAMETER  Buffer not valid\r
   @retval EFI_SUCCESS            Buffer successfully freed.\r
@@ -144,7 +120,8 @@ CoreAllocatePoolI (
 **/\r
 EFI_STATUS\r
 CoreFreePoolI (\r
-  IN VOID       *Buffer\r
+  IN VOID               *Buffer,\r
+  OUT EFI_MEMORY_TYPE   *PoolType OPTIONAL\r
   );\r
 \r
 \r