]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/MemoryAllocationLib.h
MdePkg/BaseLib: add PatchInstructionX86()
[mirror_edk2.git] / MdePkg / Include / Library / MemoryAllocationLib.h
index 9b8e3aa62be4fe7616267e4c4c90763ccb4f885e..0df59e60a38608c4b27fde71a60a24b5cd81d5dd 100644 (file)
@@ -6,8 +6,8 @@
   and SMM (for example) is done via a different mechanism. Using a common library interface makes it \r
   much easier to port algorithms from phase to phase. \r
   \r
-Copyright (c) 2006 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2013, 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -83,7 +83,8 @@ AllocateReservedPages (
 \r
   Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer.  Buffer\r
   must have been allocated on a previous call to the page allocation services of the Memory\r
-  Allocation Library.\r
+  Allocation Library.  If it is not possible to free allocated pages, then this function will\r
+  perform no actions.\r
   \r
   If Buffer was not allocated with a page allocation function in the Memory Allocation Library,\r
   then ASSERT().\r
@@ -109,6 +110,7 @@ FreePages (
   request, then NULL is returned.\r
   \r
   If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r
+  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().\r
 \r
   @param  Pages                 The number of 4 KB pages to allocate.\r
   @param  Alignment             The requested alignment of the allocation.  Must be a power of two.\r
@@ -133,6 +135,7 @@ AllocateAlignedPages (
   request, then NULL is returned.\r
   \r
   If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r
+  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().\r
 \r
   @param  Pages                 The number of 4 KB pages to allocate.\r
   @param  Alignment             The requested alignment of the allocation.  Must be a power of two.\r
@@ -157,6 +160,7 @@ AllocateAlignedRuntimePages (
   request, then NULL is returned.\r
   \r
   If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r
+  If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().\r
 \r
   @param  Pages                 The number of 4 KB pages to allocate.\r
   @param  Alignment             The requested alignment of the allocation.  Must be a power of two.\r
@@ -178,7 +182,8 @@ AllocateAlignedReservedPages (
 \r
   Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer.  Buffer\r
   must have been allocated on a previous call to the aligned page allocation services of the Memory\r
-  Allocation Library.\r
+  Allocation Library.  If it is not possible to free allocated pages, then this function will \r
+  perform no actions.\r
   \r
   If Buffer was not allocated with an aligned page allocation function in the Memory Allocation\r
   Library, then ASSERT().\r
@@ -381,16 +386,15 @@ AllocateReservedCopyPool (
 /**\r
   Reallocates a buffer of type EfiBootServicesData.\r
 \r
-  Allocates and zeros the number bytes specified by NewSize with the memmory type\r
+  Allocates and zeros the number bytes specified by NewSize from memory of type\r
   EfiBootServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and \r
   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and \r
   OldBuffer is freed.  A pointer to the newly allocated buffer is returned.  \r
   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not \r
   enough memory remaining to satisfy the request, then NULL is returned.\r
   \r
-  If OldBuffer is NULL, then ASSERT().\r
-  If NewSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
-  If OldSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
+  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
 \r
   @param  OldSize        The size, in bytes, of OldBuffer.\r
   @param  NewSize        The size, in bytes, of the buffer to reallocate.\r
@@ -411,16 +415,15 @@ ReallocatePool (
 /**\r
   Reallocates a buffer of type EfiRuntimeServicesData.\r
 \r
-  Allocates and zeros the number bytes specified by NewSize with the memmory type\r
+  Allocates and zeros the number bytes specified by NewSize from memory of type\r
   EfiRuntimeServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and \r
   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and \r
   OldBuffer is freed.  A pointer to the newly allocated buffer is returned.  \r
   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not \r
   enough memory remaining to satisfy the request, then NULL is returned.\r
-  \r
-  If OldBuffer is NULL, then ASSERT().\r
-  If NewSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
-  If OldSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
+\r
+  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
 \r
   @param  OldSize        The size, in bytes, of OldBuffer.\r
   @param  NewSize        The size, in bytes, of the buffer to reallocate.\r
@@ -441,16 +444,15 @@ ReallocateRuntimePool (
 /**\r
   Reallocates a buffer of type EfiReservedMemoryType.\r
 \r
-  Allocates and zeros the number bytes specified by NewSize with the memmory type\r
+  Allocates and zeros the number bytes specified by NewSize from memory of type\r
   EfiReservedMemoryType.  If OldBuffer is not NULL, then the smaller of OldSize and \r
   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and \r
   OldBuffer is freed.  A pointer to the newly allocated buffer is returned.  \r
   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not \r
   enough memory remaining to satisfy the request, then NULL is returned.\r
-  \r
-  If OldBuffer is NULL, then ASSERT().\r
-  If NewSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
-  If OldSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
+\r
+  If the allocation of the new buffer is successful and the smaller of NewSize and OldSize\r
+  is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().\r
 \r
   @param  OldSize        The size, in bytes, of OldBuffer.\r
   @param  NewSize        The size, in bytes, of the buffer to reallocate.\r
@@ -473,7 +475,8 @@ ReallocateReservedPool (
   Memory Allocation Library.\r
 \r
   Frees the buffer specified by Buffer.  Buffer must have been allocated on a previous call to the\r
-  pool allocation services of the Memory Allocation Library.\r
+  pool allocation services of the Memory Allocation Library.  If it is not possible to free pool\r
+  resources, then this function will perform no actions.\r
   \r
   If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,\r
   then ASSERT().\r