TianoCore EDK2 master
|
#include "StandaloneMmMemLibInternal.h"
Go to the source code of this file.
Functions | |
BOOLEAN EFIAPI | MmIsBufferOutsideMmValid (IN EFI_PHYSICAL_ADDRESS Buffer, IN UINT64 Length) |
EFI_STATUS EFIAPI | MmCopyMemToMmram (OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length) |
EFI_STATUS EFIAPI | MmCopyMemFromMmram (OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length) |
EFI_STATUS EFIAPI | MmCopyMem (OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length) |
EFI_STATUS EFIAPI | MmSetMem (OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value) |
EFI_STATUS EFIAPI | MemLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *MmSystemTable) |
EFI_STATUS EFIAPI | MemLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_MM_SYSTEM_TABLE *MmSystemTable) |
Variables | |
EFI_PHYSICAL_ADDRESS | mMmMemLibInternalMaximumSupportAddress = 0 |
Instance 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 - 2021, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file StandaloneMmMemLib.c.
EFI_STATUS EFIAPI MemLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_MM_SYSTEM_TABLE * | MmSystemTable | ||
) |
The constructor function initializes the Mm Mem library
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | MmSystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The constructor always returns EFI_SUCCESS. |
Definition at line 225 of file StandaloneMmMemLib.c.
EFI_STATUS EFIAPI MemLibDestructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_MM_SYSTEM_TABLE * | MmSystemTable | ||
) |
Destructor for Mm Mem library.
ImageHandle | The image handle of the process. |
MmSystemTable | The EFI System Table pointer. |
EFI_SUCCESS | The constructor always returns EFI_SUCCESS. |
Definition at line 254 of file StandaloneMmMemLib.c.
EFI_STATUS EFIAPI MmCopyMem | ( | OUT VOID * | DestinationBuffer, |
IN CONST VOID * | SourceBuffer, | ||
IN UINTN | Length | ||
) |
Copies a source buffer (NON-MMRAM) to a destination buffer (NON-MMRAM).
This function copies a source buffer (non-MMRAM) to a destination buffer (MMRAM). It checks if source buffer and destination buffer are valid per processor architecture and not overlap with MMRAM. If the check passes, it copies memory and returns EFI_SUCCESS. If the check fails, it returns EFI_SECURITY_VIOLATION. The implementation must be reentrant, and it must handle the case where source buffer overlaps destination buffer.
DestinationBuffer | The pointer to the destination buffer of the memory copy. |
SourceBuffer | The pointer to the source buffer of the memory copy. |
Length | The number of bytes to copy from SourceBuffer to DestinationBuffer. |
EFI_SECURITY_VIOLATION | The DestinationBuffer is invalid per processor architecture or overlap with MMRAM. |
EFI_SECURITY_VIOLATION | The SourceBuffer is invalid per processor architecture or overlap with MMRAM. |
EFI_SUCCESS | Memory is copied. |
Definition at line 156 of file StandaloneMmMemLib.c.
EFI_STATUS EFIAPI MmCopyMemFromMmram | ( | OUT VOID * | DestinationBuffer, |
IN CONST VOID * | SourceBuffer, | ||
IN UINTN | Length | ||
) |
Copies a source buffer (MMRAM) to a destination buffer (NON-MMRAM).
This function copies a source buffer (non-MMRAM) to a destination buffer (MMRAM). It checks if destination buffer is valid per processor architecture and not overlap with MMRAM. If the check passes, it copies memory and returns EFI_SUCCESS. If the check fails, it returns EFI_SECURITY_VIOLATION. The implementation must be reentrant.
DestinationBuffer | The pointer to the destination buffer of the memory copy. |
SourceBuffer | The pointer to the source buffer of the memory copy. |
Length | The number of bytes to copy from SourceBuffer to DestinationBuffer. |
EFI_SECURITY_VIOLATION | The DestinationBuffer is invalid per processor architecture or overlap with MMRAM. |
EFI_SUCCESS | Memory is copied. |
Definition at line 116 of file StandaloneMmMemLib.c.
EFI_STATUS EFIAPI MmCopyMemToMmram | ( | OUT VOID * | DestinationBuffer, |
IN CONST VOID * | SourceBuffer, | ||
IN UINTN | Length | ||
) |
Copies a source buffer (non-MMRAM) to a destination buffer (MMRAM).
This function copies a source buffer (non-MMRAM) to a destination buffer (MMRAM). It checks if source buffer is valid per processor architecture and not overlap with MMRAM. If the check passes, it copies memory and returns EFI_SUCCESS. If the check fails, it return EFI_SECURITY_VIOLATION. The implementation must be reentrant.
DestinationBuffer | The pointer to the destination buffer of the memory copy. |
SourceBuffer | The pointer to the source buffer of the memory copy. |
Length | The number of bytes to copy from SourceBuffer to DestinationBuffer. |
EFI_SECURITY_VIOLATION | The SourceBuffer is invalid per processor architecture or overlap with MMRAM. |
EFI_SUCCESS | Memory is copied. |
Definition at line 82 of file StandaloneMmMemLib.c.
BOOLEAN EFIAPI MmIsBufferOutsideMmValid | ( | IN EFI_PHYSICAL_ADDRESS | Buffer, |
IN UINT64 | Length | ||
) |
This function check if the buffer is valid per processor architecture and not overlap with MMRAM.
Buffer | The buffer start address to be checked. |
Length | The buffer length to be checked. |
TRUE | This buffer is valid per processor architecture and not overlap with MMRAM. |
FALSE | This buffer is not valid per processor architecture or overlap with MMRAM. |
Definition at line 34 of file StandaloneMmMemLib.c.
EFI_STATUS EFIAPI MmSetMem | ( | OUT VOID * | Buffer, |
IN UINTN | Length, | ||
IN UINT8 | Value | ||
) |
Fills a target buffer (NON-MMRAM) with a byte value.
This function fills a target buffer (non-MMRAM) with a byte value. It checks if target buffer is valid per processor architecture and not overlap with MMRAM. If the check passes, it fills memory and returns EFI_SUCCESS. If the check fails, it returns EFI_SECURITY_VIOLATION.
Buffer | The memory to set. |
Length | The number of bytes to set. |
Value | The value with which to fill Length bytes of Buffer. |
EFI_SECURITY_VIOLATION | The Buffer is invalid per processor architecture or overlap with MMRAM. |
EFI_SUCCESS | Memory is set. |
Definition at line 199 of file StandaloneMmMemLib.c.
EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress = 0 |
Definition at line 21 of file StandaloneMmMemLib.c.