]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Clarify that FreePages(), FreeAlignedPages(), and FreePool() may perform n actions...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 9 May 2009 01:13:40 +0000 (01:13 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 9 May 2009 01:13:40 +0000 (01:13 +0000)
Update comments in PeiMemoryAllocationLib and UefiMemoryAllocationLib to match updates to MemoryAllocationLib.h.

Add ASSERT() statements in PeiMemoryAllocationLib for the FreePages() and FreeAlignedPages() if Pages is 0.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8275 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Library/MemoryAllocationLib.h
MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c

index 74f7673cd7b02490e4e135e84b2a5976ad4e2e55..8cc93f2bae663280aedd80ba20e786795eb1506c 100644 (file)
@@ -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
+  peform no actions.\r
   \r
   If Buffer was not allocated with a page allocation function in the Memory Allocation Library,\r
   then ASSERT().\r
@@ -178,7 +179,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
+  peform no actions.\r
   \r
   If Buffer was not allocated with an aligned page allocation function in the Memory Allocation\r
   Library, then ASSERT().\r
@@ -470,7 +472,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 peform no actions.\r
   \r
   If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,\r
   then ASSERT().\r
index f9e723ef2f1ac3cb44cf960f9bb9cbc46d5a32ee..4e5f8fadd492be1943766624ccb8f638c563da71 100644 (file)
@@ -128,7 +128,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
+  peform no actions.\r
   \r
   If Buffer was not allocated with a page allocation function in the Memory Allocation Library,\r
   then ASSERT().\r
@@ -145,6 +146,7 @@ FreePages (
   IN UINTN  Pages\r
   )\r
 {\r
+  ASSERT (Pages != 0);\r
   //\r
   // PEI phase does not support to free pages, so leave it as NOP.\r
   //\r
@@ -288,7 +290,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
+  peform no actions.\r
   \r
   If Buffer was not allocated with an aligned page allocation function in the Memory Allocation\r
   Library, then ASSERT().\r
@@ -305,6 +308,7 @@ FreeAlignedPages (
   IN UINTN  Pages\r
   )\r
 {\r
+  ASSERT (Pages != 0);\r
   //\r
   // PEI phase does not support to free pages, so leave it as NOP.\r
   //\r
@@ -775,7 +779,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 peform no actions.\r
   \r
   If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,\r
   then ASSERT().\r
index 2a9f128424fa46cffb6c3167097962a6bb01a1c4..08bb2921abece60bd640755bcb4b7c0e5cdcb39f 100644 (file)
@@ -127,7 +127,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
+  peform no actions.\r
   \r
   If Buffer was not allocated with a page allocation function in the Memory Allocation Library,\r
   then ASSERT().\r
@@ -323,7 +324,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
+  peform no actions.\r
   \r
   If Buffer was not allocated with an aligned page allocation function in the Memory Allocation\r
   Library, then ASSERT().\r
@@ -792,7 +794,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 peform no actions.\r
   \r
   If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,\r
   then ASSERT().\r