TianoCore EDK2 master
Loading...
Searching...
No Matches
SdHcMem.c File Reference
#include "SdBlockIoPei.h"

Go to the source code of this file.

Functions

SD_PEIM_MEM_BLOCKSdPeimAllocMemBlock (IN UINTN Pages)
 
VOID SdPeimFreeMemBlock (IN SD_PEIM_MEM_POOL *Pool, IN SD_PEIM_MEM_BLOCK *Block)
 
VOID * SdPeimAllocMemFromBlock (IN SD_PEIM_MEM_BLOCK *Block, IN UINTN Units)
 
VOID SdPeimInsertMemBlockToPool (IN SD_PEIM_MEM_BLOCK *Head, IN SD_PEIM_MEM_BLOCK *Block)
 
BOOLEAN SdPeimIsMemBlockEmpty (IN SD_PEIM_MEM_BLOCK *Block)
 
EFI_STATUS SdPeimInitMemPool (IN SD_PEIM_HC_PRIVATE_DATA *Private)
 
EFI_STATUS SdPeimFreeMemPool (IN SD_PEIM_MEM_POOL *Pool)
 
VOID * SdPeimAllocateMem (IN SD_PEIM_MEM_POOL *Pool, IN UINTN Size)
 
VOID SdPeimFreeMem (IN SD_PEIM_MEM_POOL *Pool, IN VOID *Mem, IN UINTN Size)
 

Detailed Description

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

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

Definition in file SdHcMem.c.

Function Documentation

◆ SdPeimAllocateMem()

VOID * SdPeimAllocateMem ( IN SD_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 SdHcMem.c.

◆ SdPeimAllocMemBlock()

SD_PEIM_MEM_BLOCK * SdPeimAllocMemBlock ( 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 SdHcMem.c.

◆ SdPeimAllocMemFromBlock()

VOID * SdPeimAllocMemFromBlock ( IN SD_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 SdHcMem.c.

◆ SdPeimFreeMem()

VOID SdPeimFreeMem ( IN SD_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 SdHcMem.c.

◆ SdPeimFreeMemBlock()

VOID SdPeimFreeMemBlock ( IN SD_PEIM_MEM_POOL Pool,
IN SD_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 SdHcMem.c.

◆ SdPeimFreeMemPool()

EFI_STATUS SdPeimFreeMemPool ( IN SD_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 SdHcMem.c.

◆ SdPeimInitMemPool()

EFI_STATUS SdPeimInitMemPool ( IN SD_PEIM_HC_PRIVATE_DATA Private)

Initialize the memory management pool for the host controller.

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

Definition at line 223 of file SdHcMem.c.

◆ SdPeimInsertMemBlockToPool()

VOID SdPeimInsertMemBlockToPool ( IN SD_PEIM_MEM_BLOCK Head,
IN SD_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 SdHcMem.c.

◆ SdPeimIsMemBlockEmpty()

BOOLEAN SdPeimIsMemBlockEmpty ( IN SD_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 SdHcMem.c.