44 Status = gMmst->MmAllocatePages (
AllocateAnyPages, MemoryType, Pages, &Memory);
45 if (EFI_ERROR (Status)) {
49 return (VOID *)(
UINTN)Memory;
178 UINTN UnalignedPages;
184 ASSERT ((Alignment & (Alignment - 1)) == 0);
190 if (Alignment > EFI_PAGE_SIZE) {
194 AlignmentMask = Alignment - 1;
199 ASSERT (RealPages > Pages);
201 Status = gMmst->MmAllocatePages (
AllocateAnyPages, MemoryType, RealPages, &Memory);
202 if (EFI_ERROR (Status)) {
206 AlignedMemory = ((
UINTN)Memory + AlignmentMask) & ~AlignmentMask;
208 if (UnalignedPages > 0) {
212 Status = gMmst->MmFreePages (Memory, UnalignedPages);
217 UnalignedPages = RealPages - Pages - UnalignedPages;
218 if (UnalignedPages > 0) {
222 Status = gMmst->MmFreePages (Memory, UnalignedPages);
229 Status = gMmst->MmAllocatePages (
AllocateAnyPages, MemoryType, Pages, &Memory);
230 if (EFI_ERROR (Status)) {
234 AlignedMemory = (
UINTN)Memory;
237 return (VOID *)AlignedMemory;
379 Status = gMmst->
MmAllocatePool (MemoryType, AllocationSize, &Memory);
380 if (EFI_ERROR (Status)) {
473 if (Memory !=
NULL) {
474 Memory =
ZeroMem (Memory, AllocationSize);
572 ASSERT (Buffer !=
NULL);
576 if (Memory !=
NULL) {
577 Memory =
CopyMem (Memory, Buffer, AllocationSize);
691 IN VOID *OldBuffer OPTIONAL
697 if ((NewBuffer !=
NULL) && (OldBuffer !=
NULL)) {
698 CopyMem (NewBuffer, OldBuffer,
MIN (OldSize, NewSize));
731 IN VOID *OldBuffer OPTIONAL
763 IN VOID *OldBuffer OPTIONAL
795 IN VOID *OldBuffer OPTIONAL
823 Status = gMmst->MmFreePool (Buffer);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define ASSERT_EFI_ERROR(StatusParameter)
VOID *EFIAPI AllocateReservedZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePages(IN VOID *Buffer, IN UINTN Pages)
VOID *EFIAPI AllocateRuntimePool(IN UINTN AllocationSize)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID *EFIAPI AllocateAlignedPages(IN UINTN Pages, IN UINTN Alignment)
VOID *EFIAPI AllocatePages(IN UINTN Pages)
VOID *EFIAPI ReallocateRuntimePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID * InternalReallocatePool(IN EFI_MEMORY_TYPE PoolType, IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID *EFIAPI AllocateAlignedReservedPages(IN UINTN Pages, IN UINTN Alignment)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateRuntimeCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
VOID *EFIAPI ReallocateReservedPool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID * InternalAllocateCopyPool(IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize, IN CONST VOID *Buffer)
VOID *EFIAPI AllocateReservedPool(IN UINTN AllocationSize)
VOID EFIAPI FreeAlignedPages(IN VOID *Buffer, IN UINTN Pages)
VOID *EFIAPI AllocateAlignedRuntimePages(IN UINTN Pages, IN UINTN Alignment)
VOID *EFIAPI AllocateReservedPages(IN UINTN Pages)
VOID * InternalAllocatePool(IN EFI_MEMORY_TYPE MemoryType, IN UINTN AllocationSize)
VOID *EFIAPI AllocateRuntimePages(IN UINTN Pages)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
VOID *EFIAPI AllocateRuntimeZeroPool(IN UINTN AllocationSize)
VOID * InternalAllocateAlignedPages(IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN UINTN Alignment)
VOID * InternalAllocateZeroPool(IN EFI_MEMORY_TYPE PoolType, IN UINTN AllocationSize)
VOID *EFIAPI AllocateReservedCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
VOID * InternalAllocatePages(IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages)
UINT64 EFI_PHYSICAL_ADDRESS
#define EFI_PAGES_TO_SIZE(Pages)
#define EFI_SIZE_TO_PAGES(Size)
EFI_ALLOCATE_POOL MmAllocatePool