]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Clean up DxeMemoryAllocationLib and PeiMemoryAllocationLib.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 24 Aug 2008 05:00:30 +0000 (05:00 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 24 Aug 2008 05:00:30 +0000 (05:00 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5722 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/DxeHobLib/HobLib.c
MdePkg/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf
MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c
MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf

index e13469534a58044ed0b876f76af4a0fdebcfba18..810bfa5fbf1d07a4ac151a7940f78c61d61ffa68 100644 (file)
@@ -34,7 +34,8 @@ STATIC VOID  *mHobList = NULL;
   @param  ImageHandle   The firmware allocated handle for the EFI image.\r
   @param  SystemTable   A pointer to the EFI System Table.\r
   \r
-  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
+  @retval EFI_SUCCESS   The constructor successfully gets HobList.\r
+  @retval Other value   The constructor can't get HobList.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -50,7 +51,7 @@ HobLibConstructor (
   ASSERT_EFI_ERROR (Status);\r
   ASSERT (mHobList != NULL);\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 /**\r
index 4031b82124cc7d077709007d502af8bf3bd185ba..5e473c0a8909c538e68be7f666ae429153159327 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # Memory Allocation Library that uses EFI Boot Services to allocate\r
 #  and free memory.\r
-# Copyright (c) 2007, Intel Corporation\r
+# Copyright (c) 2007 - 2008, Intel Corporation\r
 #\r
 #  All rights reserved. This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
index a4b397383bb35a32409fe8b98658d41649972125..e8229f76beb8eaffe1e36fc35732efd21a7a6113 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
-  Support routines for memory allocation routines for use with drivers.\r
+  Support routines for memory allocation routines based \r
+  on boot services for Dxe phase drivers.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
   All rights reserved. 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
@@ -49,7 +50,7 @@ InternalAllocatePages (
 \r
   Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory);\r
   if (EFI_ERROR (Status)) {\r
-    Memory = 0;\r
+    return NULL;\r
   }\r
   return (VOID *) (UINTN) Memory;\r
 }\r
@@ -536,7 +537,7 @@ AllocateReservedZeroPool (
   allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there\r
   is not enough memory remaining to satisfy the request, then NULL is returned.\r
   If Buffer is NULL, then ASSERT().\r
-  If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
 \r
   @param  PoolType              The type of pool to allocate.\r
   @param  AllocationSize        The number of bytes to allocate and zero.\r
@@ -572,7 +573,7 @@ InternalAllocateCopyPool (
   allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there\r
   is not enough memory remaining to satisfy the request, then NULL is returned.\r
   If Buffer is NULL, then ASSERT().\r
-  If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
 \r
   @param  AllocationSize        The number of bytes to allocate and zero.\r
   @param  Buffer                The buffer to copy to the allocated buffer.\r
@@ -598,7 +599,7 @@ AllocateCopyPool (
   allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there\r
   is not enough memory remaining to satisfy the request, then NULL is returned.\r
   If Buffer is NULL, then ASSERT().\r
-  If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
 \r
   @param  AllocationSize        The number of bytes to allocate and zero.\r
   @param  Buffer                The buffer to copy to the allocated buffer.\r
@@ -624,7 +625,7 @@ AllocateRuntimeCopyPool (
   allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there\r
   is not enough memory remaining to satisfy the request, then NULL is returned.\r
   If Buffer is NULL, then ASSERT().\r
-  If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
 \r
   @param  AllocationSize        The number of bytes to allocate and zero.\r
   @param  Buffer                The buffer to copy to the allocated buffer.\r
index 09c90cb1b07dab165d10832f509f3832d1590cdf..f937369cc77093d0af31290dc7c5a2a27c0caddb 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
-  Support routines for memory allocation routines for use with drivers.\r
+  Support routines for memory allocation routines \r
+  based on PeiService for PEI phase drivers.\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
   All rights reserved. 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
@@ -17,7 +18,6 @@
 \r
 \r
 #include <Library/MemoryAllocationLib.h>\r
-#include <Library/PeiServicesTablePointerLib.h>\r
 #include <Library/PeiServicesLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -51,7 +51,7 @@ InternalAllocatePages (
 \r
   Status = PeiServicesAllocatePages (MemoryType, Pages, &Memory);\r
   if (EFI_ERROR (Status)) {\r
-    Memory = 0;\r
+    return NULL;\r
   }\r
   return (VOID *) (UINTN) Memory;\r
 }\r
@@ -511,7 +511,7 @@ AllocateReservedZeroPool (
   allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there\r
   is not enough memory remaining to satisfy the request, then NULL is returned.\r
   If Buffer is NULL, then ASSERT().\r
-  If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
 \r
   @param  PoolType              The type of pool to allocate.\r
   @param  AllocationSize        The number of bytes to allocate and zero.\r
@@ -547,7 +547,7 @@ InternalAllocateCopyPool (
   allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there\r
   is not enough memory remaining to satisfy the request, then NULL is returned.\r
   If Buffer is NULL, then ASSERT().\r
-  If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
 \r
   @param  AllocationSize        The number of bytes to allocate and zero.\r
   @param  Buffer                The buffer to copy to the allocated buffer.\r
@@ -582,7 +582,7 @@ AllocateCopyPool (
   allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there\r
   is not enough memory remaining to satisfy the request, then NULL is returned.\r
   If Buffer is NULL, then ASSERT().\r
-  If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
 \r
   @param  AllocationSize        The number of bytes to allocate and zero.\r
   @param  Buffer                The buffer to copy to the allocated buffer.\r
@@ -608,7 +608,7 @@ AllocateRuntimeCopyPool (
   allocated buffer.  If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there\r
   is not enough memory remaining to satisfy the request, then NULL is returned.\r
   If Buffer is NULL, then ASSERT().\r
-  If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+  If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
 \r
   @param  AllocationSize        The number of bytes to allocate and zero.\r
   @param  Buffer                The buffer to copy to the allocated buffer.\r
index 081d287035c0e479f74171440910899bbbf7d1fe..6cb6327f3bdd51f1fa28dbc8c29de157e2cf7386 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # Memory Allocation Library that uses PEI Services to allocate memory.\r
 #  Free operations are ignored.\r
-# Copyright (c) 2007, Intel Corporation\r
+# Copyright (c) 2007 - 2008, Intel Corporation\r
 #\r
 #  All rights reserved. This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -40,6 +40,5 @@
 [LibraryClasses]\r
   DebugLib\r
   BaseMemoryLib\r
-  PeiServicesTablePointerLib\r
   PeiServicesLib\r
 \r