TianoCore EDK2 master
Loading...
Searching...
No Matches
Pool.c File Reference
#include "PiSmmCore.h"

Go to the source code of this file.

Functions

SMM_POOL_TYPE UefiMemoryTypeToSmmPoolType (IN EFI_MEMORY_TYPE MemoryType)
 
VOID SmmInitializeMemoryServices (IN UINTN SmramRangeCount, IN EFI_SMRAM_DESCRIPTOR *SmramRanges)
 
EFI_STATUS InternalAllocPoolByIndex (IN EFI_MEMORY_TYPE PoolType, IN UINTN PoolIndex, OUT FREE_POOL_HEADER **FreePoolHdr)
 
STATIC EFI_STATUS InternalFreePoolByIndex (IN FREE_POOL_HEADER *FreePoolHdr, IN POOL_TAIL *PoolTail OPTIONAL)
 
EFI_STATUS EFIAPI SmmInternalAllocatePool (IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer)
 
EFI_STATUS EFIAPI SmmAllocatePool (IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer)
 
EFI_STATUS EFIAPI SmmInternalFreePool (IN VOID *Buffer)
 
EFI_STATUS EFIAPI SmmFreePool (IN VOID *Buffer)
 

Variables

LIST_ENTRY mSmmPoolLists [SmmPoolTypeMax][MAX_POOL_INDEX]
 
GLOBAL_REMOVE_IF_UNREFERENCED EFI_PHYSICAL_ADDRESS gLoadModuleAtFixAddressSmramBase = 0
 

Detailed Description

SMM Memory pool management functions.

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

Definition in file Pool.c.

Function Documentation

◆ InternalAllocPoolByIndex()

EFI_STATUS InternalAllocPoolByIndex ( IN EFI_MEMORY_TYPE  PoolType,
IN UINTN  PoolIndex,
OUT FREE_POOL_HEADER **  FreePoolHdr 
)

Internal Function. Allocate a pool by specified PoolIndex.

Parameters
PoolTypeType of pool to allocate.
PoolIndexIndex which indicate the Pool size.
FreePoolHdrThe returned Free pool.
Return values
EFI_OUT_OF_RESOURCESAllocation failed.
EFI_SUCCESSPool successfully allocated.

Definition at line 122 of file Pool.c.

◆ InternalFreePoolByIndex()

STATIC EFI_STATUS InternalFreePoolByIndex ( IN FREE_POOL_HEADER *  FreePoolHdr,
IN POOL_TAIL *PoolTail  OPTIONAL 
)

Internal Function. Free a pool by specified PoolIndex.

Parameters
FreePoolHdrThe pool to free.
PoolTailThe pointer to the pool tail.
Return values
EFI_SUCCESSPool successfully freed.

Definition at line 196 of file Pool.c.

◆ SmmAllocatePool()

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

Definition at line 342 of file Pool.c.

◆ SmmFreePool()

EFI_STATUS EFIAPI SmmFreePool ( 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 449 of file Pool.c.

◆ SmmInitializeMemoryServices()

VOID SmmInitializeMemoryServices ( IN UINTN  SmramRangeCount,
IN EFI_SMRAM_DESCRIPTOR *  SmramRanges 
)

Called to initialize the memory service.

Parameters
SmramRangeCountNumber of SMRAM Regions
SmramRangesPointer to SMRAM Descriptors

Definition at line 49 of file Pool.c.

◆ SmmInternalAllocatePool()

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

Definition at line 239 of file Pool.c.

◆ SmmInternalFreePool()

EFI_STATUS EFIAPI SmmInternalFreePool ( 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 376 of file Pool.c.

◆ UefiMemoryTypeToSmmPoolType()

SMM_POOL_TYPE UefiMemoryTypeToSmmPoolType ( IN EFI_MEMORY_TYPE  MemoryType)

Convert a UEFI memory type to SMM pool type.

Parameters
[in]MemoryTypeType of pool to allocate.
Returns
SMM pool type

Definition at line 26 of file Pool.c.

Variable Documentation

◆ gLoadModuleAtFixAddressSmramBase

GLOBAL_REMOVE_IF_UNREFERENCED EFI_PHYSICAL_ADDRESS gLoadModuleAtFixAddressSmramBase = 0

Definition at line 16 of file Pool.c.

◆ mSmmPoolLists

LIST_ENTRY mSmmPoolLists[SmmPoolTypeMax][MAX_POOL_INDEX]

Definition at line 11 of file Pool.c.