TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | MEMORY_MAP |
Macros | |
#define | MEMORY_MAP_SIGNATURE SIGNATURE_32('m','m','a','p') |
Functions | |
VOID * | CoreAllocatePoolPages (IN EFI_MEMORY_TYPE PoolType, IN UINTN NumberOfPages, IN UINTN Alignment, IN BOOLEAN NeedGuard) |
VOID | CoreFreePoolPages (IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NumberOfPages) |
VOID * | CoreAllocatePoolI (IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, IN BOOLEAN NeedGuard) |
EFI_STATUS | CoreFreePoolI (IN VOID *Buffer, OUT EFI_MEMORY_TYPE *PoolType OPTIONAL) |
VOID | CoreAcquireMemoryLock (VOID) |
VOID | CoreReleaseMemoryLock (VOID) |
EFI_STATUS EFIAPI | CoreInternalAllocatePages (IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN NumberOfPages, IN OUT EFI_PHYSICAL_ADDRESS *Memory, IN BOOLEAN NeedGuard) |
Variables | |
EFI_LOCK | gMemoryLock |
LIST_ENTRY | gMemoryMap |
LIST_ENTRY | mGcdMemorySpaceMap |
Data structure and functions to allocate and free memory space.
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Imem.h.
#define MEMORY_MAP_SIGNATURE SIGNATURE_32('m','m','a','p') |
VOID CoreAcquireMemoryLock | ( | VOID | ) |
VOID * CoreAllocatePoolI | ( | IN EFI_MEMORY_TYPE | PoolType, |
IN UINTN | Size, | ||
IN BOOLEAN | NeedGuard | ||
) |
Internal function to allocate pool of a particular type. Caller must have the memory lock held
PoolType | Type of pool to allocate |
Size | The amount of pool to allocate |
NeedGuard | Flag to indicate Guard page is needed or not |
VOID * CoreAllocatePoolPages | ( | IN EFI_MEMORY_TYPE | PoolType, |
IN UINTN | NumberOfPages, | ||
IN UINTN | Alignment, | ||
IN BOOLEAN | NeedGuard | ||
) |
Internal function. Used by the pool functions to allocate pages to back pool allocation requests.
PoolType | The type of memory for the new pool pages |
NumberOfPages | No of pages to allocate |
Alignment | Bits to align. |
NeedGuard | Flag to indicate Guard page is needed or not |
EFI_STATUS CoreFreePoolI | ( | IN VOID * | Buffer, |
OUT EFI_MEMORY_TYPE *PoolType | OPTIONAL | ||
) |
VOID CoreFreePoolPages | ( | IN EFI_PHYSICAL_ADDRESS | Memory, |
IN UINTN | NumberOfPages | ||
) |
EFI_STATUS EFIAPI CoreInternalAllocatePages | ( | IN EFI_ALLOCATE_TYPE | Type, |
IN EFI_MEMORY_TYPE | MemoryType, | ||
IN UINTN | NumberOfPages, | ||
IN OUT EFI_PHYSICAL_ADDRESS * | Memory, | ||
IN BOOLEAN | NeedGuard | ||
) |
Allocates pages from the memory map.
Type | The type of allocation to perform |
MemoryType | The type of memory to turn the allocated pages into |
NumberOfPages | The number of pages to allocate |
Memory | A pointer to receive the base allocated memory address |
NeedGuard | Flag to indicate Guard page is needed or not |
EFI_INVALID_PARAMETER | Parameters violate checking rules defined in spec. |
EFI_NOT_FOUND | Could not allocate pages match the requirement. |
EFI_OUT_OF_RESOURCES | No enough pages to allocate. |
EFI_SUCCESS | Pages successfully allocated. |
VOID CoreReleaseMemoryLock | ( | VOID | ) |
|
extern |
|
extern |