21#define PAGE_HEAD_PRIVATE_SIGNATURE SIGNATURE_32 ('P', 'H', 'D', 'R')
30 VOID *AllocatedBufffer;
157 ASSERT ((Alignment & (Alignment - 1)) == 0);
159 if (Alignment < SIZE_4KB) {
160 Alignment = SIZE_4KB;
163 AlignmentMask = Alignment - 1;
170 PageHead.AlignedPages = Pages;
172 if (PageHead.AllocatedBufffer ==
NULL) {
176 PageHead.AlignedBuffer = (VOID *)(((
UINTN)PageHead.AllocatedBufffer + AlignmentMask) & ~AlignmentMask);
177 if ((
UINTN)PageHead.AlignedBuffer - (
UINTN)PageHead.AllocatedBufffer < sizeof (
PAGE_HEAD)) {
178 PageHead.AlignedBuffer = (VOID *)((
UINTN)PageHead.AlignedBuffer + Alignment);
181 PageHeadPtr = (VOID *)((
UINTN)PageHead.AlignedBuffer -
sizeof (
PAGE_HEAD));
182 memcpy (PageHeadPtr, &PageHead,
sizeof (
PAGE_HEAD));
184 return PageHead.AlignedBuffer;
277 if (PageHeadPtr->AlignedPages != Pages) {
281 PageHeadPtr->Signature = 0;
282 free (PageHeadPtr->AllocatedBufffer);
302 return malloc (AllocationSize);
368 Buffer = malloc (AllocationSize);
369 if (Buffer ==
NULL) {
373 memset (Buffer, 0, AllocationSize);
447 Memory = malloc (AllocationSize);
448 if (Memory ==
NULL) {
452 memcpy (Memory, Buffer, AllocationSize);
536 IN VOID *OldBuffer OPTIONAL
541 NewBuffer = malloc (NewSize);
542 if ((NewBuffer !=
NULL) && (OldBuffer !=
NULL)) {
543 memcpy (NewBuffer, OldBuffer,
MIN (OldSize, NewSize));
546 if (OldBuffer !=
NULL) {
579 IN VOID *OldBuffer OPTIONAL
611 IN VOID *OldBuffer OPTIONAL
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 *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 *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 *EFIAPI AllocateRuntimePages(IN UINTN Pages)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
VOID *EFIAPI AllocateRuntimeZeroPool(IN UINTN AllocationSize)
VOID *EFIAPI AllocateReservedCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define PAGE_HEAD_PRIVATE_SIGNATURE
#define EFI_PAGES_TO_SIZE(Pages)
#define EFI_SIZE_TO_PAGES(Size)