TianoCore EDK2 master
|
#include "UnitTestUefiBootServicesTableLib.h"
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | UnitTestAllocatePages (IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN NumberOfPages, IN OUT EFI_PHYSICAL_ADDRESS *Memory) |
EFI_STATUS EFIAPI | UnitTestFreePages (IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NumberOfPages) |
EFI_STATUS EFIAPI | UnitTestGetMemoryMap (IN OUT UINTN *MemoryMapSize, IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, OUT UINTN *MapKey, OUT UINTN *DescriptorSize, OUT UINT32 *DescriptorVersion) |
EFI_STATUS EFIAPI | UnitTestAllocatePool (IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer) |
EFI_STATUS EFIAPI | UnitTestFreePool (IN VOID *Buffer) |
Implementation of memory related services in the UEFI Boot Services table for use in unit tests.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestAllocatePages | ( | IN EFI_ALLOCATE_TYPE | Type, |
IN EFI_MEMORY_TYPE | MemoryType, | ||
IN UINTN | NumberOfPages, | ||
IN OUT EFI_PHYSICAL_ADDRESS * | Memory | ||
) |
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 |
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. |
Definition at line 31 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestAllocatePool | ( | IN EFI_MEMORY_TYPE | PoolType, |
IN UINTN | Size, | ||
OUT VOID ** | Buffer | ||
) |
Allocate pool of a particular type.
PoolType | Type of pool to allocate |
Size | The amount of pool to allocate |
Buffer | The address to return a pointer to the allocated pool |
EFI_INVALID_PARAMETER | PoolType not valid or Buffer is NULL |
EFI_OUT_OF_RESOURCES | Size exceeds max pool size or allocation failed. |
EFI_SUCCESS | Pool successfully allocated. |
Definition at line 120 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestFreePages | ( | IN EFI_PHYSICAL_ADDRESS | Memory, |
IN UINTN | NumberOfPages | ||
) |
Frees previous allocated pages.
Memory | Base address of memory being freed |
NumberOfPages | The number of pages to free |
EFI_NOT_FOUND | Could not find the entry that covers the range |
EFI_INVALID_PARAMETER | Address not aligned |
Definition at line 54 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestFreePool | ( | IN VOID * | Buffer | ) |
Frees pool.
Buffer | The allocated pool entry to free |
EFI_INVALID_PARAMETER | Buffer is not a valid value. |
EFI_SUCCESS | Pool successfully freed. |
Definition at line 140 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestGetMemoryMap | ( | IN OUT UINTN * | MemoryMapSize, |
IN OUT EFI_MEMORY_DESCRIPTOR * | MemoryMap, | ||
OUT UINTN * | MapKey, | ||
OUT UINTN * | DescriptorSize, | ||
OUT UINT32 * | DescriptorVersion | ||
) |
This function returns a copy of the current memory map. The map is an array of memory descriptors, each of which describes a contiguous block of memory.
MemoryMapSize | A pointer to the size, in bytes, of the MemoryMap buffer. On input, this is the size of the buffer allocated by the caller. On output, it is the size of the buffer returned by the firmware if the buffer was large enough, or the size of the buffer needed to contain the map if the buffer was too small. |
MemoryMap | A pointer to the buffer in which firmware places the current memory map. |
MapKey | A pointer to the location in which firmware returns the key for the current memory map. |
DescriptorSize | A pointer to the location in which firmware returns the size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. |
DescriptorVersion | A pointer to the location in which firmware returns the version number associated with the EFI_MEMORY_DESCRIPTOR. |
EFI_SUCCESS | The memory map was returned in the MemoryMap buffer. |
EFI_BUFFER_TOO_SMALL | The MemoryMap buffer was too small. The current buffer size needed to hold the memory map is returned in MemoryMapSize. |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
Definition at line 94 of file UnitTestUefiBootServicesTableLibMemory.c.