From 8789c5e05f3ee45c7831d101caa157b11df3b43b Mon Sep 17 00:00:00 2001 From: gikidy Date: Fri, 21 Nov 2008 06:34:54 +0000 Subject: [PATCH] synchronize the MdePkg/Include/Library/MemoryAllocationLib.h,PalLib.h the MDE_Library_Spec. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6660 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/MemoryAllocationLib.h | 20 ++++++++++++++++--- MdePkg/Include/Library/PalLib.h | 10 +++++++++- .../MemoryAllocationLib.c | 4 ++-- .../MemoryAllocationLib.c | 4 ++-- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/MdePkg/Include/Library/MemoryAllocationLib.h b/MdePkg/Include/Library/MemoryAllocationLib.h index 17328b3bf5..347e45a24e 100644 --- a/MdePkg/Include/Library/MemoryAllocationLib.h +++ b/MdePkg/Include/Library/MemoryAllocationLib.h @@ -1,6 +1,11 @@ /** @file Provides services to allocate and free memory buffers of various memory types and alignments. - + + The Memory Allocation Library abstracts various common memory allocation operations. This library + allows code to be written in a phase-independent manner because the allocation of memory in PEI, DXE, + and SMM (for example) is done via a different mechanism. Using a common library interface makes it + much easier to port algorithms from phase to phase. + Copyright (c) 2006 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -79,6 +84,7 @@ AllocateReservedPages ( Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer must have been allocated on a previous call to the page allocation services of the Memory Allocation Library. + If Buffer was not allocated with a page allocation function in the Memory Allocation Library, then ASSERT(). If Pages is zero, then ASSERT(). @@ -101,6 +107,7 @@ FreePages ( alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is returned. If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned. + If Alignment is not a power of two and Alignment is not zero, then ASSERT(). @param Pages The number of 4 KB pages to allocate. @@ -124,6 +131,7 @@ AllocateAlignedPages ( alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is returned. If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned. + If Alignment is not a power of two and Alignment is not zero, then ASSERT(). @param Pages The number of 4 KB pages to allocate. @@ -147,6 +155,7 @@ AllocateAlignedRuntimePages ( alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is returned. If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned. + If Alignment is not a power of two and Alignment is not zero, then ASSERT(). @param Pages The number of 4 KB pages to allocate. @@ -170,6 +179,7 @@ AllocateAlignedReservedPages ( Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer must have been allocated on a previous call to the aligned page allocation services of the Memory Allocation Library. + If Buffer was not allocated with an aligned page allocation function in the Memory Allocation Library, then ASSERT(). If Pages is zero, then ASSERT(). @@ -222,9 +232,9 @@ AllocateRuntimePool ( ); /** - Allocates a buffer of type EfieservedMemoryType. + Allocates a buffer of type EfiReservedMemoryType. - Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType and returns + Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. @@ -303,6 +313,7 @@ AllocateReservedZeroPool ( AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. + If Buffer is NULL, then ASSERT(). If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). @@ -326,6 +337,7 @@ AllocateCopyPool ( AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. + If Buffer is NULL, then ASSERT(). If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). @@ -349,6 +361,7 @@ AllocateRuntimeCopyPool ( AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. + If Buffer is NULL, then ASSERT(). If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). @@ -371,6 +384,7 @@ AllocateReservedCopyPool ( Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the pool allocation services of the Memory Allocation Library. + If Buffer was not allocated with a pool allocation function in the Memory Allocation Library, then ASSERT(). diff --git a/MdePkg/Include/Library/PalLib.h b/MdePkg/Include/Library/PalLib.h index 33480a171e..5b9761f57f 100644 --- a/MdePkg/Include/Library/PalLib.h +++ b/MdePkg/Include/Library/PalLib.h @@ -1,6 +1,14 @@ /** @file Provides library services to make PAL Calls. - + + The PAL Library provides a service to make a PAL CALL. This service is identical + in functionality to AsmPalCall() in the Itanium specific functions of the Base Library. + The only difference is that the PAL Entry Point is not passed in. Implementations + of this library class must manage PAL Entry Point on their own. For example, a PEI + implementation can use a PPI to lookup the PAL Entry Point, and a DXE implementation + can contain a constructor to look up the PAL Entry Point from a HOB. This library class + is only available on IPF. + Copyright (c) 2006 -2008, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c index 5df1ce6cfb..a94a550886 100644 --- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c @@ -382,9 +382,9 @@ AllocateRuntimePool ( } /** - Allocates a buffer of type EfieservedMemoryType. + Allocates a buffer of type EfiReservedMemoryType. - Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType and returns + Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. diff --git a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c index d4ac3b86e6..e2aeccd546 100644 --- a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c @@ -414,9 +414,9 @@ AllocateRuntimePool ( } /** - Allocates a buffer of type EfieservedMemoryType. + Allocates a buffer of type EfiReservedMemoryType. - Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType and returns + Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. -- 2.39.2