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

Go to the source code of this file.

Data Structures

struct  NON_MM_MEMORY_RANGE
 

Functions

VOID MmMemLibCalculateMaximumSupportAddress (VOID)
 
STATIC VOID MergeOverlappedOrContinuousRanges (IN OUT NON_MM_MEMORY_RANGE *MemoryRange, IN OUT UINTN *MemoryRangeSize)
 
INTN EFIAPI NonMmMapCompare (IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
 
VOID MmMemLibInitializeValidNonMmramRanges (VOID)
 
VOID MmMemLibFreeValidNonMmramRanges (VOID)
 
BOOLEAN MmMemLibIsValidNonMmramRange (IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length)
 

Variables

NON_MM_MEMORY_RANGEmValidNonMmramRanges
 
UINTN mValidNonMmramCount
 
EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress
 

Detailed Description

Internal ARCH Specific file of MM memory check library.

MM memory check library implementation. This library consumes MM_ACCESS_PROTOCOL to get MMRAM information. In order to use this library instance, the platform should produce all MMRAM range via MM_ACCESS_PROTOCOL, including the range for firmware (like MM Core and MM driver) and/or specific dedicated hardware.

Copyright (c) 2015 - 2024, Intel Corporation. All rights reserved.
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
Copyright (c) Microsoft Corporation.

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

Definition in file X86StandaloneMmMemLibInternal.c.

Function Documentation

◆ MergeOverlappedOrContinuousRanges()

STATIC VOID MergeOverlappedOrContinuousRanges ( IN OUT NON_MM_MEMORY_RANGE MemoryRange,
IN OUT UINTN MemoryRangeSize 
)

Merge the overlapped or continuous ranges in input MemoryRange. This function is to optimize the process of checking whether a buffer range belongs to the range reported by resource HOB, since the buffer to be checked may be covered by multi resource HOB.

Parameters
[in,out]MemoryRangeA pointer to the NonMmramRanges reported by resource HOB.
[in,out]MemoryRangeSizeA pointer to the size, in bytes, of the MemoryRange buffer. On input, it is the size of the current memory map. On output, it is the size of new memory map after merge.

Definition at line 90 of file X86StandaloneMmMemLibInternal.c.

◆ MmMemLibCalculateMaximumSupportAddress()

VOID MmMemLibCalculateMaximumSupportAddress ( VOID  )

Calculate and save the maximum support address.

Definition at line 39 of file X86StandaloneMmMemLibInternal.c.

◆ MmMemLibFreeValidNonMmramRanges()

VOID MmMemLibFreeValidNonMmramRanges ( VOID  )

Deinitialize cached non-Mmram Ranges.

Definition at line 232 of file X86StandaloneMmMemLibInternal.c.

◆ MmMemLibInitializeValidNonMmramRanges()

VOID MmMemLibInitializeValidNonMmramRanges ( VOID  )

Initialize valid non-Mmram Ranges from Resource HOB.

Definition at line 169 of file X86StandaloneMmMemLibInternal.c.

◆ MmMemLibIsValidNonMmramRange()

BOOLEAN MmMemLibIsValidNonMmramRange ( IN EFI_PHYSICAL_ADDRESS  Buffer,
IN UINT64  Length 
)

This function check if the buffer is valid non-MMRAM memory range.

Parameters
[in]BufferThe buffer start address to be checked.
[in]LengthThe buffer length to be checked.
Return values
TRUEThis buffer is valid non-MMRAM memory range.
FALSEThis buffer is not valid non-MMRAM memory range.

Definition at line 251 of file X86StandaloneMmMemLibInternal.c.

◆ NonMmMapCompare()

INTN EFIAPI NonMmMapCompare ( IN CONST VOID *  Buffer1,
IN CONST VOID *  Buffer2 
)

Function to compare 2 NON_MM_MEMORY_RANGE pointer based on Base.

Parameters
[in]Buffer1pointer to NON_MM_MEMORY_RANGE pointer to compare
[in]Buffer2pointer to second NON_MM_MEMORY_RANGE pointer to compare
Return values
0Buffer1 equal to Buffer2
<0Buffer1 is less than Buffer2
>0Buffer1 is greater than Buffer2

Definition at line 150 of file X86StandaloneMmMemLibInternal.c.

Variable Documentation

◆ mMmMemLibInternalMaximumSupportAddress

EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress
extern

Definition at line 21 of file StandaloneMmMemLib.c.

◆ mValidNonMmramCount

UINTN mValidNonMmramCount

Definition at line 27 of file X86StandaloneMmMemLibInternal.c.

◆ mValidNonMmramRanges

NON_MM_MEMORY_RANGE* mValidNonMmramRanges

Definition at line 26 of file X86StandaloneMmMemLibInternal.c.