TianoCore EDK2 master
Loading...
Searching...
No Matches
EmmcHcMem.c File Reference
#include "EmmcBlockIoPei.h"

Go to the source code of this file.

Functions

EMMC_PEIM_MEM_BLOCKEmmcPeimAllocMemBlock (IN UINTN Pages)
 
VOID EmmcPeimFreeMemBlock (IN EMMC_PEIM_MEM_POOL *Pool, IN EMMC_PEIM_MEM_BLOCK *Block)
 
VOID * EmmcPeimAllocMemFromBlock (IN EMMC_PEIM_MEM_BLOCK *Block, IN UINTN Units)
 
VOID EmmcPeimInsertMemBlockToPool (IN EMMC_PEIM_MEM_BLOCK *Head, IN EMMC_PEIM_MEM_BLOCK *Block)
 
BOOLEAN EmmcPeimIsMemBlockEmpty (IN EMMC_PEIM_MEM_BLOCK *Block)
 
EFI_STATUS EmmcPeimInitMemPool (IN EMMC_PEIM_HC_PRIVATE_DATA *Private)
 
EFI_STATUS EmmcPeimFreeMemPool (IN EMMC_PEIM_MEM_POOL *Pool)
 
VOID * EmmcPeimAllocateMem (IN EMMC_PEIM_MEM_POOL *Pool, IN UINTN Size)
 
VOID EmmcPeimFreeMem (IN EMMC_PEIM_MEM_POOL *Pool, IN VOID *Mem, IN UINTN Size)
 

Detailed Description

Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EmmcHcMem.c.

Function Documentation

◆ EmmcPeimAllocateMem()

VOID * EmmcPeimAllocateMem ( IN EMMC_PEIM_MEM_POOL Pool,
IN UINTN  Size 
)

Allocate some memory from the host controller's memory pool which can be used to communicate with host controller.

Parameters
PoolThe host controller's memory pool.
SizeSize of the memory to allocate.
Returns
The allocated memory or NULL.

Definition at line 294 of file EmmcHcMem.c.

◆ EmmcPeimAllocMemBlock()

EMMC_PEIM_MEM_BLOCK * EmmcPeimAllocMemBlock ( IN UINTN  Pages)

Allocate a block of memory to be used by the buffer pool.

Parameters
PagesHow many pages to allocate.
Returns
The allocated memory block or NULL if failed.

Definition at line 20 of file EmmcHcMem.c.

◆ EmmcPeimAllocMemFromBlock()

VOID * EmmcPeimAllocMemFromBlock ( IN EMMC_PEIM_MEM_BLOCK Block,
IN UINTN  Units 
)

Alloc some memory from the block.

Parameters
BlockThe memory block to allocate memory from.
UnitsNumber of memory units to allocate.
Returns
The pointer to the allocated memory. If couldn't allocate the needed memory, the return value is NULL.

Definition at line 109 of file EmmcHcMem.c.

◆ EmmcPeimFreeMem()

VOID EmmcPeimFreeMem ( IN EMMC_PEIM_MEM_POOL Pool,
IN VOID *  Mem,
IN UINTN  Size 
)

Free the allocated memory back to the memory pool.

Parameters
PoolThe memory pool of the host controller.
MemThe memory to free.
SizeThe size of the memory to free.

Definition at line 366 of file EmmcHcMem.c.

◆ EmmcPeimFreeMemBlock()

VOID EmmcPeimFreeMemBlock ( IN EMMC_PEIM_MEM_POOL Pool,
IN EMMC_PEIM_MEM_BLOCK Block 
)

Free the memory block from the memory pool.

Parameters
PoolThe memory pool to free the block from.
BlockThe memory block to free.

Definition at line 88 of file EmmcHcMem.c.

◆ EmmcPeimFreeMemPool()

EFI_STATUS EmmcPeimFreeMemPool ( IN EMMC_PEIM_MEM_POOL Pool)

Release the memory management pool.

Parameters
PoolThe memory pool to free.
Return values
EFI_DEVICE_ERRORFail to free the memory pool.
EFI_SUCCESSThe memory pool is freed.

Definition at line 263 of file EmmcHcMem.c.

◆ EmmcPeimInitMemPool()

EFI_STATUS EmmcPeimInitMemPool ( IN EMMC_PEIM_HC_PRIVATE_DATA Private)

Initialize the memory management pool for the host controller.

Parameters
PrivateThe Emmc Peim driver private data.
Return values
EFI_SUCCESSThe memory pool is initialized.
OthersFail to init the memory pool.

Definition at line 223 of file EmmcHcMem.c.

◆ EmmcPeimInsertMemBlockToPool()

VOID EmmcPeimInsertMemBlockToPool ( IN EMMC_PEIM_MEM_BLOCK Head,
IN EMMC_PEIM_MEM_BLOCK Block 
)

Insert the memory block to the pool's list of the blocks.

Parameters
HeadThe head of the memory pool's block list.
BlockThe memory block to insert.

Definition at line 178 of file EmmcHcMem.c.

◆ EmmcPeimIsMemBlockEmpty()

BOOLEAN EmmcPeimIsMemBlockEmpty ( IN EMMC_PEIM_MEM_BLOCK Block)

Is the memory block empty?

Parameters
BlockThe memory block to check.
Return values
TRUEThe memory block is empty.
FALSEThe memory block isn't empty.

Definition at line 198 of file EmmcHcMem.c.