2 Contains function prototypes for Memory Services in DxeCore.
4 This header file borrows the DxeCore Memory Allocation services as the primitive
7 Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef _DXE_CORE_MEMORY_ALLOCATION_SERVICES_H_
13 #define _DXE_CORE_MEMORY_ALLOCATION_SERVICES_H_
17 Allocates pages from the memory map.
19 @param Type The type of allocation to perform
20 @param MemoryType The type of memory to turn the allocated pages
22 @param NumberOfPages The number of pages to allocate
23 @param Memory A pointer to receive the base allocated memory
26 @return Status. On success, Memory is filled in with the base address allocated
27 @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in
29 @retval EFI_NOT_FOUND Could not allocate pages match the requirement.
30 @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.
31 @retval EFI_SUCCESS Pages successfully allocated.
37 IN EFI_ALLOCATE_TYPE Type
,
38 IN EFI_MEMORY_TYPE MemoryType
,
39 IN UINTN NumberOfPages
,
40 IN OUT EFI_PHYSICAL_ADDRESS
*Memory
46 Frees previous allocated pages.
48 @param Memory Base address of memory being freed
49 @param NumberOfPages The number of pages to free
51 @retval EFI_NOT_FOUND Could not find the entry that covers the range
52 @retval EFI_INVALID_PARAMETER Address not aligned
53 @return EFI_SUCCESS -Pages successfully freed.
59 IN EFI_PHYSICAL_ADDRESS Memory
,
60 IN UINTN NumberOfPages
65 Allocate pool of a particular type.
67 @param PoolType Type of pool to allocate
68 @param Size The amount of pool to allocate
69 @param Buffer The address to return a pointer to the allocated
72 @retval EFI_INVALID_PARAMETER PoolType not valid
73 @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.
74 @retval EFI_SUCCESS Pool successfully allocated.
80 IN EFI_MEMORY_TYPE PoolType
,
88 @param Buffer The allocated pool entry to free
90 @retval EFI_INVALID_PARAMETER Buffer is not a valid value.
91 @retval EFI_SUCCESS Pool successfully freed.