2 Support routines for memory allocation routines based
3 on boot services for Dxe phase drivers.
5 Copyright (c) 2006 - 2008, Intel Corporation<BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #include <Library/MemoryAllocationLib.h>
21 #include <Library/BaseMemoryLib.h>
22 #include <Library/DebugLib.h>
23 #include "DxeCoreMemoryAllocationServices.h"
26 Allocates one or more 4KB pages of a certain memory type.
28 Allocates the number of 4KB pages of a certain memory type and returns a pointer to the allocated
29 buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL is returned.
30 If there is not enough memory remaining to satisfy the request, then NULL is returned.
32 @param MemoryType The type of memory to allocate.
33 @param Pages The number of 4 KB pages to allocate.
35 @return A pointer to the allocated buffer or NULL if allocation fails.
39 InternalAllocatePages (
40 IN EFI_MEMORY_TYPE MemoryType
,
45 EFI_PHYSICAL_ADDRESS Memory
;
51 Status
= CoreAllocatePages (AllocateAnyPages
, MemoryType
, Pages
, &Memory
);
52 if (EFI_ERROR (Status
)) {
55 return (VOID
*) (UINTN
) Memory
;
59 Allocates one or more 4KB pages of type EfiBootServicesData.
61 Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the
62 allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
63 is returned. If there is not enough memory remaining to satisfy the request, then NULL is
66 @param Pages The number of 4 KB pages to allocate.
68 @return A pointer to the allocated buffer or NULL if allocation fails.
77 return InternalAllocatePages (EfiBootServicesData
, Pages
);
81 Allocates one or more 4KB pages of type EfiRuntimeServicesData.
83 Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the
84 allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
85 is returned. If there is not enough memory remaining to satisfy the request, then NULL is
88 @param Pages The number of 4 KB pages to allocate.
90 @return A pointer to the allocated buffer or NULL if allocation fails.
95 AllocateRuntimePages (
99 return InternalAllocatePages (EfiRuntimeServicesData
, Pages
);
103 Allocates one or more 4KB pages of type EfiReservedMemoryType.
105 Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a pointer to the
106 allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
107 is returned. If there is not enough memory remaining to satisfy the request, then NULL is
110 @param Pages The number of 4 KB pages to allocate.
112 @return A pointer to the allocated buffer or NULL if allocation fails.
117 AllocateReservedPages (
121 return InternalAllocatePages (EfiReservedMemoryType
, Pages
);
125 Frees one or more 4KB pages that were previously allocated with one of the page allocation
126 functions in the Memory Allocation Library.
128 Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
129 must have been allocated on a previous call to the page allocation services of the Memory
130 Allocation Library. If it is not possible to free allocated pages, then this function will
133 If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
135 If Pages is zero, then ASSERT().
137 @param Buffer Pointer to the buffer of pages to free.
138 @param Pages The number of 4 KB pages to free.
151 Status
= CoreFreePages ((EFI_PHYSICAL_ADDRESS
) (UINTN
) Buffer
, Pages
);
152 ASSERT_EFI_ERROR (Status
);
156 Allocates one or more 4KB pages of a certain memory type at a specified alignment.
158 Allocates the number of 4KB pages specified by Pages of a certain memory type with an alignment
159 specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is returned.
160 If there is not enough memory at the specified alignment remaining to satisfy the request, then
162 If Alignment is not a power of two and Alignment is not zero, then ASSERT().
164 @param MemoryType The type of memory to allocate.
165 @param Pages The number of 4 KB pages to allocate.
166 @param Alignment The requested alignment of the allocation. Must be a power of two.
167 If Alignment is zero, then byte alignment is used.
169 @return A pointer to the allocated buffer or NULL if allocation fails.
173 InternalAllocateAlignedPages (
174 IN EFI_MEMORY_TYPE MemoryType
,
180 EFI_PHYSICAL_ADDRESS Memory
;
183 UINTN UnalignedPages
;
187 // Alignment must be a power of two or zero.
189 ASSERT ((Alignment
& (Alignment
- 1)) == 0);
194 if (Alignment
> EFI_PAGE_SIZE
) {
196 // Caculate the total number of pages since alignment is larger than page size.
198 AlignmentMask
= Alignment
- 1;
199 RealPages
= Pages
+ EFI_SIZE_TO_PAGES (Alignment
);
201 // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.
203 ASSERT (RealPages
> Pages
);
205 Status
= CoreAllocatePages (AllocateAnyPages
, MemoryType
, RealPages
, &Memory
);
206 if (EFI_ERROR (Status
)) {
209 AlignedMemory
= ((UINTN
) Memory
+ AlignmentMask
) & ~AlignmentMask
;
210 UnalignedPages
= EFI_SIZE_TO_PAGES (AlignedMemory
- (UINTN
) Memory
);
211 if (UnalignedPages
> 0) {
213 // Free first unaligned page(s).
215 Status
= CoreFreePages (Memory
, UnalignedPages
);
216 ASSERT_EFI_ERROR (Status
);
218 Memory
= (EFI_PHYSICAL_ADDRESS
) (AlignedMemory
+ EFI_PAGES_TO_SIZE (Pages
));
219 UnalignedPages
= RealPages
- Pages
- UnalignedPages
;
220 if (UnalignedPages
> 0) {
222 // Free last unaligned page(s).
224 Status
= CoreFreePages (Memory
, UnalignedPages
);
225 ASSERT_EFI_ERROR (Status
);
229 // Do not over-allocate pages in this case.
231 Status
= CoreAllocatePages (AllocateAnyPages
, MemoryType
, Pages
, &Memory
);
232 if (EFI_ERROR (Status
)) {
235 AlignedMemory
= (UINTN
) Memory
;
237 return (VOID
*) AlignedMemory
;
241 Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
243 Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
244 alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
245 returned. If there is not enough memory at the specified alignment remaining to satisfy the
246 request, then NULL is returned.
248 If Alignment is not a power of two and Alignment is not zero, then ASSERT().
250 @param Pages The number of 4 KB pages to allocate.
251 @param Alignment The requested alignment of the allocation. Must be a power of two.
252 If Alignment is zero, then byte alignment is used.
254 @return A pointer to the allocated buffer or NULL if allocation fails.
259 AllocateAlignedPages (
264 return InternalAllocateAlignedPages (EfiBootServicesData
, Pages
, Alignment
);
268 Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.
270 Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an
271 alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
272 returned. If there is not enough memory at the specified alignment remaining to satisfy the
273 request, then NULL is returned.
275 If Alignment is not a power of two and Alignment is not zero, then ASSERT().
277 @param Pages The number of 4 KB pages to allocate.
278 @param Alignment The requested alignment of the allocation. Must be a power of two.
279 If Alignment is zero, then byte alignment is used.
281 @return A pointer to the allocated buffer or NULL if allocation fails.
286 AllocateAlignedRuntimePages (
291 return InternalAllocateAlignedPages (EfiRuntimeServicesData
, Pages
, Alignment
);
295 Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
297 Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType with an
298 alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
299 returned. If there is not enough memory at the specified alignment remaining to satisfy the
300 request, then NULL is returned.
302 If Alignment is not a power of two and Alignment is not zero, then ASSERT().
304 @param Pages The number of 4 KB pages to allocate.
305 @param Alignment The requested alignment of the allocation. Must be a power of two.
306 If Alignment is zero, then byte alignment is used.
308 @return A pointer to the allocated buffer or NULL if allocation fails.
313 AllocateAlignedReservedPages (
318 return InternalAllocateAlignedPages (EfiReservedMemoryType
, Pages
, Alignment
);
322 Frees one or more 4KB pages that were previously allocated with one of the aligned page
323 allocation functions in the Memory Allocation Library.
325 Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
326 must have been allocated on a previous call to the aligned page allocation services of the Memory
327 Allocation Library. If it is not possible to free allocated pages, then this function will
330 If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
331 Library, then ASSERT().
332 If Pages is zero, then ASSERT().
334 @param Buffer Pointer to the buffer of pages to free.
335 @param Pages The number of 4 KB pages to free.
348 Status
= CoreFreePages ((EFI_PHYSICAL_ADDRESS
) (UINTN
) Buffer
, Pages
);
349 ASSERT_EFI_ERROR (Status
);
353 Allocates a buffer of a certain pool type.
355 Allocates the number bytes specified by AllocationSize of a certain pool type and returns a
356 pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
357 returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
359 @param MemoryType The type of memory to allocate.
360 @param AllocationSize The number of bytes to allocate.
362 @return A pointer to the allocated buffer or NULL if allocation fails.
366 InternalAllocatePool (
367 IN EFI_MEMORY_TYPE MemoryType
,
368 IN UINTN AllocationSize
374 Status
= CoreAllocatePool (MemoryType
, AllocationSize
, &Memory
);
375 if (EFI_ERROR (Status
)) {
382 Allocates a buffer of type EfiBootServicesData.
384 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a
385 pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
386 returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
388 @param AllocationSize The number of bytes to allocate.
390 @return A pointer to the allocated buffer or NULL if allocation fails.
396 IN UINTN AllocationSize
399 return InternalAllocatePool (EfiBootServicesData
, AllocationSize
);
403 Allocates a buffer of type EfiRuntimeServicesData.
405 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns
406 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
407 returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
409 @param AllocationSize The number of bytes to allocate.
411 @return A pointer to the allocated buffer or NULL if allocation fails.
416 AllocateRuntimePool (
417 IN UINTN AllocationSize
420 return InternalAllocatePool (EfiRuntimeServicesData
, AllocationSize
);
424 Allocates a buffer of type EfiReservedMemoryType.
426 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType and returns
427 a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
428 returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
430 @param AllocationSize The number of bytes to allocate.
432 @return A pointer to the allocated buffer or NULL if allocation fails.
437 AllocateReservedPool (
438 IN UINTN AllocationSize
441 return InternalAllocatePool (EfiReservedMemoryType
, AllocationSize
);
445 Allocates and zeros a buffer of a certain pool type.
447 Allocates the number bytes specified by AllocationSize of a certain pool type, clears the buffer
448 with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid
449 buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request,
450 then NULL is returned.
452 @param PoolType The type of memory to allocate.
453 @param AllocationSize The number of bytes to allocate and zero.
455 @return A pointer to the allocated buffer or NULL if allocation fails.
459 InternalAllocateZeroPool (
460 IN EFI_MEMORY_TYPE PoolType
,
461 IN UINTN AllocationSize
466 Memory
= InternalAllocatePool (PoolType
, AllocationSize
);
467 if (Memory
!= NULL
) {
468 Memory
= ZeroMem (Memory
, AllocationSize
);
474 Allocates and zeros a buffer of type EfiBootServicesData.
476 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the
477 buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
478 valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
479 request, then NULL is returned.
481 @param AllocationSize The number of bytes to allocate and zero.
483 @return A pointer to the allocated buffer or NULL if allocation fails.
489 IN UINTN AllocationSize
492 return InternalAllocateZeroPool (EfiBootServicesData
, AllocationSize
);
496 Allocates and zeros a buffer of type EfiRuntimeServicesData.
498 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, clears the
499 buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
500 valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
501 request, then NULL is returned.
503 @param AllocationSize The number of bytes to allocate and zero.
505 @return A pointer to the allocated buffer or NULL if allocation fails.
510 AllocateRuntimeZeroPool (
511 IN UINTN AllocationSize
514 return InternalAllocateZeroPool (EfiRuntimeServicesData
, AllocationSize
);
518 Allocates and zeros a buffer of type EfiReservedMemoryType.
520 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, clears the
521 buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
522 valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
523 request, then NULL is returned.
525 @param AllocationSize The number of bytes to allocate and zero.
527 @return A pointer to the allocated buffer or NULL if allocation fails.
532 AllocateReservedZeroPool (
533 IN UINTN AllocationSize
536 return InternalAllocateZeroPool (EfiReservedMemoryType
, AllocationSize
);
540 Copies a buffer to an allocated buffer of a certain pool type.
542 Allocates the number bytes specified by AllocationSize of a certain pool type, copies
543 AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
544 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
545 is not enough memory remaining to satisfy the request, then NULL is returned.
546 If Buffer is NULL, then ASSERT().
547 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
549 @param PoolType The type of pool to allocate.
550 @param AllocationSize The number of bytes to allocate and zero.
551 @param Buffer The buffer to copy to the allocated buffer.
553 @return A pointer to the allocated buffer or NULL if allocation fails.
557 InternalAllocateCopyPool (
558 IN EFI_MEMORY_TYPE PoolType
,
559 IN UINTN AllocationSize
,
560 IN CONST VOID
*Buffer
565 ASSERT (Buffer
!= NULL
);
566 ASSERT (AllocationSize
<= (MAX_ADDRESS
- (UINTN
) Buffer
+ 1));
568 Memory
= InternalAllocatePool (PoolType
, AllocationSize
);
569 if (Memory
!= NULL
) {
570 Memory
= CopyMem (Memory
, Buffer
, AllocationSize
);
576 Copies a buffer to an allocated buffer of type EfiBootServicesData.
578 Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, copies
579 AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
580 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
581 is not enough memory remaining to satisfy the request, then NULL is returned.
583 If Buffer is NULL, then ASSERT().
584 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
586 @param AllocationSize The number of bytes to allocate and zero.
587 @param Buffer The buffer to copy to the allocated buffer.
589 @return A pointer to the allocated buffer or NULL if allocation fails.
595 IN UINTN AllocationSize
,
596 IN CONST VOID
*Buffer
599 return InternalAllocateCopyPool (EfiBootServicesData
, AllocationSize
, Buffer
);
603 Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
605 Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, copies
606 AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
607 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
608 is not enough memory remaining to satisfy the request, then NULL is returned.
610 If Buffer is NULL, then ASSERT().
611 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
613 @param AllocationSize The number of bytes to allocate and zero.
614 @param Buffer The buffer to copy to the allocated buffer.
616 @return A pointer to the allocated buffer or NULL if allocation fails.
621 AllocateRuntimeCopyPool (
622 IN UINTN AllocationSize
,
623 IN CONST VOID
*Buffer
626 return InternalAllocateCopyPool (EfiRuntimeServicesData
, AllocationSize
, Buffer
);
630 Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
632 Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, copies
633 AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
634 allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
635 is not enough memory remaining to satisfy the request, then NULL is returned.
637 If Buffer is NULL, then ASSERT().
638 If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
640 @param AllocationSize The number of bytes to allocate and zero.
641 @param Buffer The buffer to copy to the allocated buffer.
643 @return A pointer to the allocated buffer or NULL if allocation fails.
648 AllocateReservedCopyPool (
649 IN UINTN AllocationSize
,
650 IN CONST VOID
*Buffer
653 return InternalAllocateCopyPool (EfiReservedMemoryType
, AllocationSize
, Buffer
);
657 Reallocates a buffer of a specified memory type.
659 Allocates and zeros the number bytes specified by NewSize from memory of the type
660 specified by PoolType. If OldBuffer is not NULL, then the smaller of OldSize and
661 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
662 OldBuffer is freed. A pointer to the newly allocated buffer is returned.
663 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not
664 enough memory remaining to satisfy the request, then NULL is returned.
666 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
667 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
669 @param PoolType The type of pool to allocate.
670 @param OldSize The size, in bytes, of OldBuffer.
671 @param NewSize The size, in bytes, of the buffer to reallocate.
672 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional
673 parameter that may be NULL.
675 @return A pointer to the allocated buffer or NULL if allocation fails.
679 InternalReallocatePool (
680 IN EFI_MEMORY_TYPE PoolType
,
683 IN VOID
*OldBuffer OPTIONAL
688 NewBuffer
= InternalAllocateZeroPool (PoolType
, NewSize
);
689 if (NewBuffer
!= NULL
&& OldBuffer
!= NULL
) {
690 CopyMem (NewBuffer
, OldBuffer
, MIN (OldSize
, NewSize
));
691 FreePool (OldBuffer
);
697 Reallocates a buffer of type EfiBootServicesData.
699 Allocates and zeros the number bytes specified by NewSize from memory of type
700 EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and
701 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
702 OldBuffer is freed. A pointer to the newly allocated buffer is returned.
703 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not
704 enough memory remaining to satisfy the request, then NULL is returned.
706 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
707 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
709 @param OldSize The size, in bytes, of OldBuffer.
710 @param NewSize The size, in bytes, of the buffer to reallocate.
711 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional
712 parameter that may be NULL.
714 @return A pointer to the allocated buffer or NULL if allocation fails.
722 IN VOID
*OldBuffer OPTIONAL
725 return InternalReallocatePool (EfiBootServicesData
, OldSize
, NewSize
, OldBuffer
);
729 Reallocates a buffer of type EfiRuntimeServicesData.
731 Allocates and zeros the number bytes specified by NewSize from memory of type
732 EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and
733 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
734 OldBuffer is freed. A pointer to the newly allocated buffer is returned.
735 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not
736 enough memory remaining to satisfy the request, then NULL is returned.
738 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
739 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
741 @param OldSize The size, in bytes, of OldBuffer.
742 @param NewSize The size, in bytes, of the buffer to reallocate.
743 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional
744 parameter that may be NULL.
746 @return A pointer to the allocated buffer or NULL if allocation fails.
751 ReallocateRuntimePool (
754 IN VOID
*OldBuffer OPTIONAL
757 return InternalReallocatePool (EfiRuntimeServicesData
, OldSize
, NewSize
, OldBuffer
);
761 Reallocates a buffer of type EfiReservedMemoryType.
763 Allocates and zeros the number bytes specified by NewSize from memory of type
764 EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and
765 NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
766 OldBuffer is freed. A pointer to the newly allocated buffer is returned.
767 If NewSize is 0, then a valid buffer of 0 size is returned. If there is not
768 enough memory remaining to satisfy the request, then NULL is returned.
770 If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
771 is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
773 @param OldSize The size, in bytes, of OldBuffer.
774 @param NewSize The size, in bytes, of the buffer to reallocate.
775 @param OldBuffer The buffer to copy to the allocated buffer. This is an optional
776 parameter that may be NULL.
778 @return A pointer to the allocated buffer or NULL if allocation fails.
783 ReallocateReservedPool (
786 IN VOID
*OldBuffer OPTIONAL
789 return InternalReallocatePool (EfiReservedMemoryType
, OldSize
, NewSize
, OldBuffer
);
793 Frees a buffer that was previously allocated with one of the pool allocation functions in the
794 Memory Allocation Library.
796 Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
797 pool allocation services of the Memory Allocation Library. If it is not possible to free pool
798 resources, then this function will perform no actions.
800 If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
803 @param Buffer Pointer to the buffer to free.
814 Status
= CoreFreePool (Buffer
);
815 ASSERT_EFI_ERROR (Status
);