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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI MmCommunication2Communicate (IN CONST EFI_MM_COMMUNICATION2_PROTOCOL *This, IN OUT VOID *CommBufferPhysical, IN OUT VOID *CommBufferVirtual, IN OUT UINTN *CommSize OPTIONAL)
 
STATIC VOID EFIAPI NotifySetVirtualAddressMap (IN EFI_EVENT Event, IN VOID *Context)
 
STATIC EFI_STATUS GetMmCompatibility ()
 
STATIC VOID EFIAPI MmGuidedEventNotify (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI MmCommunication2Initialize (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC ARM_MEMORY_REGION_DESCRIPTOR mNsCommBuffMemRegion
 
STATIC EFI_EVENT mSetVirtualAddressMapEvent
 
STATIC EFI_HANDLE mMmCommunicateHandle
 
STATIC EFI_MM_COMMUNICATION2_PROTOCOL mMmCommunication2
 
STATIC EFI_GUID *CONST mGuidedEventGuid []
 
STATIC EFI_EVENT mGuidedEvent [ARRAY_SIZE(mGuidedEventGuid)]
 

Detailed Description

Copyright (c) 2016-2021, Arm Limited. All rights reserved.

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

Definition in file MmCommunication.c.

Function Documentation

◆ GetMmCompatibility()

STATIC EFI_STATUS GetMmCompatibility ( )

Definition at line 248 of file MmCommunication.c.

◆ MmCommunication2Communicate()

EFI_STATUS EFIAPI MmCommunication2Communicate ( IN CONST EFI_MM_COMMUNICATION2_PROTOCOL This,
IN OUT VOID *  CommBufferPhysical,
IN OUT VOID *  CommBufferVirtual,
IN OUT UINTN *CommSize  OPTIONAL 
)

Communicates with a registered handler.

This function provides a service to send and receive messages from a registered UEFI service.

Parameters
[in]ThisThe EFI_MM_COMMUNICATION_PROTOCOL instance.
[in,out]CommBufferPhysicalPhysical address of the MM communication buffer
[in,out]CommBufferVirtualVirtual address of the MM communication buffer
[in,out]CommSizeThe size of the data buffer being passed in. On input, when not omitted, the buffer should cover EFI_MM_COMMUNICATE_HEADER and the value of MessageLength field. On exit, the size of data being returned. Zero if the handler does not wish to reply with any data. This parameter is optional and may be NULL.
Return values
EFI_SUCCESSThe message was successfully posted.
EFI_INVALID_PARAMETERCommBufferPhysical or CommBufferVirtual was NULL, or integer value pointed by CommSize does not cover EFI_MM_COMMUNICATE_HEADER and the value of MessageLength field.
EFI_BAD_BUFFER_SIZEThe buffer is too large for the MM implementation. If this error is returned, the MessageLength field in the CommBuffer header or the integer pointed by CommSize, are updated to reflect the maximum payload size the implementation can accommodate.
EFI_ACCESS_DENIEDThe CommunicateBuffer parameter or CommSize parameter, if not omitted, are in address range that cannot be accessed by the MM environment.

Definition at line 71 of file MmCommunication.c.

◆ MmCommunication2Initialize()

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

The Entry Point for MM Communication

This function installs the MM communication protocol interface and finds out what type of buffer management will be required prior to invoking the communication SMC.

Parameters
ImageHandleThe firmware allocated handle for the EFI image.
SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
OtherSome error occurred when executing this entry point.

Definition at line 340 of file MmCommunication.c.

◆ MmGuidedEventNotify()

STATIC VOID EFIAPI MmGuidedEventNotify ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Event notification that is fired when GUIDed Event Group is signaled.

Parameters
EventThe Event that is being processed, not used.
ContextEvent Context, not used.

Definition at line 305 of file MmCommunication.c.

◆ NotifySetVirtualAddressMap()

STATIC VOID EFIAPI NotifySetVirtualAddressMap ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Notification callback on SetVirtualAddressMap event.

This function notifies the MM communication protocol interface on SetVirtualAddressMap event and converts pointers used in this driver from physical to virtual address.

Parameters
EventSetVirtualAddressMap event.
ContextA context when the SetVirtualAddressMap triggered.
Return values
EFI_SUCCESSThe function executed successfully.
OtherSome error occurred when executing this function.

Definition at line 225 of file MmCommunication.c.

Variable Documentation

◆ mGuidedEvent

STATIC EFI_EVENT mGuidedEvent[ARRAY_SIZE(mGuidedEventGuid)]

Definition at line 293 of file MmCommunication.c.

◆ mGuidedEventGuid

STATIC EFI_GUID* CONST mGuidedEventGuid[]
Initial value:
= {
&gEfiEndOfDxeEventGroupGuid,
&gEfiEventExitBootServicesGuid,
&gEfiEventReadyToBootGuid,
}

Definition at line 287 of file MmCommunication.c.

◆ mMmCommunicateHandle

STATIC EFI_HANDLE mMmCommunicateHandle

Definition at line 37 of file MmCommunication.c.

◆ mMmCommunication2

Initial value:
= {
}
EFI_STATUS EFIAPI MmCommunication2Communicate(IN CONST EFI_MM_COMMUNICATION2_PROTOCOL *This, IN OUT VOID *CommBufferPhysical, IN OUT VOID *CommBufferVirtual, IN OUT UINTN *CommSize OPTIONAL)

Definition at line 204 of file MmCommunication.c.

◆ mNsCommBuffMemRegion

STATIC ARM_MEMORY_REGION_DESCRIPTOR mNsCommBuffMemRegion

Definition at line 29 of file MmCommunication.c.

◆ mSetVirtualAddressMapEvent

STATIC EFI_EVENT mSetVirtualAddressMapEvent

Definition at line 32 of file MmCommunication.c.