@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
ASSERT_EFI_ERROR (Status);\r
ASSERT (mHobList != NULL);\r
\r
- return EFI_SUCCESS;\r
+ return Status;\r
}\r
\r
/**\r
#\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
/** @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
\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
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
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
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
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
/** @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
\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
\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
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
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
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
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
#\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
[LibraryClasses]\r
DebugLib\r
BaseMemoryLib\r
- PeiServicesTablePointerLib\r
PeiServicesLib\r
\r