TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmMemoryProfileLib.c File Reference

Go to the source code of this file.

Functions

BOOLEAN EFIAPI BufferInSmram (IN VOID *Buffer)
 
EFI_STATUS EFIAPI SmmMemoryProfileLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI MemoryProfileLibRecord (IN PHYSICAL_ADDRESS CallerAddress, IN MEMORY_PROFILE_ACTION Action, IN EFI_MEMORY_TYPE MemoryType, IN VOID *Buffer, IN UINTN Size, IN CHAR8 *ActionString OPTIONAL)
 

Variables

EDKII_MEMORY_PROFILE_PROTOCOLmLibProfileProtocol
 
EDKII_SMM_MEMORY_PROFILE_PROTOCOLmLibSmmProfileProtocol
 

Detailed Description

Support routines for memory profile for Smm phase drivers.

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

Definition in file SmmMemoryProfileLib.c.

Function Documentation

◆ BufferInSmram()

BOOLEAN EFIAPI BufferInSmram ( IN VOID *  Buffer)

Check whether the start address of buffer is within any of the SMRAM ranges.

Parameters
[in]BufferThe pointer to the buffer to be checked.
Return values
TRUEThe buffer is in SMRAM ranges.
FALSEThe buffer is out of SMRAM ranges.

Definition at line 42 of file MemoryAllocationLib.c.

◆ MemoryProfileLibRecord()

EFI_STATUS EFIAPI MemoryProfileLibRecord ( IN PHYSICAL_ADDRESS  CallerAddress,
IN MEMORY_PROFILE_ACTION  Action,
IN EFI_MEMORY_TYPE  MemoryType,
IN VOID *  Buffer,
IN UINTN  Size,
IN CHAR8 *ActionString  OPTIONAL 
)

Record memory profile of multilevel caller.

Parameters
[in]CallerAddressAddress of caller.
[in]ActionMemory profile action.
[in]MemoryTypeMemory type. EfiMaxMemoryType means the MemoryType is unknown.
[in]BufferBuffer address.
[in]SizeBuffer size.
[in]ActionStringString for memory profile action. Only needed for user defined allocate action.
Returns
EFI_SUCCESS Memory profile is updated.
EFI_UNSUPPORTED Memory profile is unsupported, or memory profile for the image is not required, or memory profile for the memory type is not required.
EFI_ACCESS_DENIED It is during memory profile data getting.
EFI_ABORTED Memory profile recording is not enabled.
EFI_OUT_OF_RESOURCES No enough resource to update memory profile for allocate action.
EFI_NOT_FOUND No matched allocate info found for free action.

Definition at line 100 of file SmmMemoryProfileLib.c.

◆ SmmMemoryProfileLibConstructor()

EFI_STATUS EFIAPI SmmMemoryProfileLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The constructor function initializes memory profile for SMM phase.

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe constructor always returns EFI_SUCCESS.

Definition at line 45 of file SmmMemoryProfileLib.c.

Variable Documentation

◆ mLibProfileProtocol

EDKII_MEMORY_PROFILE_PROTOCOL* mLibProfileProtocol

Definition at line 17 of file SmmMemoryProfileLib.c.

◆ mLibSmmProfileProtocol

EDKII_SMM_MEMORY_PROFILE_PROTOCOL* mLibSmmProfileProtocol

Definition at line 18 of file SmmMemoryProfileLib.c.