TianoCore EDK2 master
Loading...
Searching...
No Matches
DxeCoreMemoryAllocationServices.h File Reference

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI CoreAllocatePages (IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN NumberOfPages, IN OUT EFI_PHYSICAL_ADDRESS *Memory)
 
EFI_STATUS EFIAPI CoreFreePages (IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NumberOfPages)
 
EFI_STATUS EFIAPI CoreAllocatePool (IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer)
 
EFI_STATUS EFIAPI CoreFreePool (IN VOID *Buffer)
 

Detailed Description

Contains function prototypes for Memory Services in DxeCore.

This header file borrows the DxeCore Memory Allocation services as the primitive for memory allocation.

Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file DxeCoreMemoryAllocationServices.h.

Function Documentation

◆ CoreAllocatePages()

EFI_STATUS EFIAPI CoreAllocatePages ( 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.

Parameters
TypeThe type of allocation to perform
MemoryTypeThe type of memory to turn the allocated pages into
NumberOfPagesThe number of pages to allocate
MemoryA pointer to receive the base allocated memory address
Returns
Status. On success, Memory is filled in with the base address allocated
Return values
EFI_INVALID_PARAMETERParameters violate checking rules defined in spec.
EFI_NOT_FOUNDCould not allocate pages match the requirement.
EFI_OUT_OF_RESOURCESNo enough pages to allocate.
EFI_SUCCESSPages successfully allocated.

◆ CoreAllocatePool()

EFI_STATUS EFIAPI CoreAllocatePool ( IN EFI_MEMORY_TYPE  PoolType,
IN UINTN  Size,
OUT VOID **  Buffer 
)

Allocate pool of a particular type.

Parameters
PoolTypeType of pool to allocate
SizeThe amount of pool to allocate
BufferThe address to return a pointer to the allocated pool
Return values
EFI_INVALID_PARAMETERPoolType not valid
EFI_OUT_OF_RESOURCESSize exceeds max pool size or allocation failed.
EFI_SUCCESSPool successfully allocated.

Allocate pool of a particular type.

Parameters
PoolTypeType of pool to allocate
SizeThe amount of pool to allocate
BufferThe address to return a pointer to the allocated pool
Return values
EFI_INVALID_PARAMETERBuffer is NULL. PoolType is in the range EfiMaxMemoryType..0x6FFFFFFF. PoolType is EfiPersistentMemory.
EFI_OUT_OF_RESOURCESSize exceeds max pool size or allocation failed.
EFI_SUCCESSPool successfully allocated.

Definition at line 267 of file Pool.c.

◆ CoreFreePages()

EFI_STATUS EFIAPI CoreFreePages ( IN EFI_PHYSICAL_ADDRESS  Memory,
IN UINTN  NumberOfPages 
)

Frees previous allocated pages.

Parameters
MemoryBase address of memory being freed
NumberOfPagesThe number of pages to free
Return values
EFI_NOT_FOUNDCould not find the entry that covers the range
EFI_INVALID_PARAMETERAddress not aligned
Returns
EFI_SUCCESS -Pages successfully freed.

Definition at line 1737 of file Page.c.

◆ CoreFreePool()

EFI_STATUS EFIAPI CoreFreePool ( IN VOID *  Buffer)

Frees pool.

Parameters
BufferThe allocated pool entry to free
Return values
EFI_INVALID_PARAMETERBuffer is not a valid value.
EFI_SUCCESSPool successfully freed.

Definition at line 591 of file Pool.c.