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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI Communicate (IN CONST EFI_PEI_SMM_COMMUNICATION_PPI *This, IN OUT VOID *CommBuffer, IN OUT UINTN *CommSize)
 
EFI_SMM_COMMUNICATION_CONTEXTGetCommunicationContext (VOID)
 
VOID SetCommunicationContext (IN EFI_SMM_COMMUNICATION_CONTEXT *SmmCommunicationContext)
 
VOID * InternalSmstGetVendorTableByGuid (IN UINT64 Signature, IN EFI_SMM_SYSTEM_TABLE2 *Smst, IN EFI_GUID *VendorGuid)
 
VOID InitCommunicationContext (VOID)
 
EFI_STATUS EFIAPI PiSmmCommunicationPeiEntryPoint (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
 

Variables

EFI_PEI_SMM_COMMUNICATION_PPI mSmmCommunicationPpi = { Communicate }
 
EFI_PEI_PPI_DESCRIPTOR mPpiList
 

Detailed Description

PiSmmCommunication PEI Driver.

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

Definition in file PiSmmCommunicationPei.c.

Function Documentation

◆ Communicate()

EFI_STATUS EFIAPI Communicate ( IN CONST EFI_PEI_SMM_COMMUNICATION_PPI This,
IN OUT VOID *  CommBuffer,
IN OUT UINTN CommSize 
)

the whole picture is below:

+-------------------------------—+ | ACPI_VARIABLE_HOB | | SmramDescriptor | <- DRAM | CpuStart |— +-------------------------------—+ | | +-------------------------------—+<– | SMM_S3_RESUME_STATE | | Signature | <- SMRAM | Smst |— +-------------------------------—+ | | +-------------------------------—+<– | EFI_SMM_SYSTEM_TABLE2 | | NumberOfTableEntries | <- SMRAM | SmmConfigurationTable |— +-------------------------------—+ | | +-------------------------------—+<– | EFI_SMM_COMMUNICATION_CONTEXT | | SwSmiNumber | <- SMRAM | BufferPtrAddress |— +-------------------------------—+ | | +-------------------------------—+<– | Communication Buffer Pointer | <- AcpiNvs +-------------------------------—+— | +-------------------------------—+<– | EFI_SMM_COMMUNICATE_HEADER | | HeaderGuid | <- DRAM | MessageLength | +-------------------------------—+ Communicates with a registered handler.

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

Parameters
[in]ThisThe EFI_PEI_SMM_COMMUNICATION_PPI instance.
[in,out]CommBufferA pointer to the buffer to convey into SMRAM.
[in,out]CommSizeThe size of the data buffer being passed in.On exit, the size of data being returned. Zero if the handler does not wish to reply with any data.
Return values
EFI_SUCCESSThe message was successfully posted.
EFI_INVALID_PARAMETERThe CommBuffer was NULL.
EFI_NOT_STARTEDThe service is NOT started.

Communicates with a registered handler.

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

Parameters
[in]ThisThe EFI_PEI_SMM_COMMUNICATION_PPI instance.
[in,out]CommBufferA pointer to the buffer to convey into SMRAM.
[in,out]CommSizeThe size of the data buffer being passed in.On exit, the size of data being returned. Zero if the handler does not wish to reply with any data.
Return values
EFI_SUCCESSThe message was successfully posted.
EFI_INVALID_PARAMETERThe CommBuffer was NULL.
EFI_NOT_STARTEDThe service is NOT started.

Definition at line 275 of file PiSmmCommunicationPei.c.

◆ GetCommunicationContext()

EFI_SMM_COMMUNICATION_CONTEXT * GetCommunicationContext ( VOID  )

Get SMM communication context.

Returns
SMM communication context.

Definition at line 135 of file PiSmmCommunicationPei.c.

◆ InitCommunicationContext()

VOID InitCommunicationContext ( VOID  )

Init SMM communication context.

Definition at line 230 of file PiSmmCommunicationPei.c.

◆ InternalSmstGetVendorTableByGuid()

VOID * InternalSmstGetVendorTableByGuid ( IN UINT64  Signature,
IN EFI_SMM_SYSTEM_TABLE2 Smst,
IN EFI_GUID VendorGuid 
)

Get VendorTable by VendorGuid in Smst.

Parameters
SignatureSignature of SMM_S3_RESUME_STATE
SmstSMM system table
VendorGuidvendor guid
Returns
vendor table.

Definition at line 183 of file PiSmmCommunicationPei.c.

◆ PiSmmCommunicationPeiEntryPoint()

EFI_STATUS EFIAPI PiSmmCommunicationPeiEntryPoint ( IN EFI_PEI_FILE_HANDLE  FileHandle,
IN CONST EFI_PEI_SERVICES **  PeiServices 
)

Entry Point for PI SMM communication PEIM.

Parameters
FileHandleHandle of the file being invoked.
PeiServicesPointer to PEI Services table.
Return values
EFI_SUCCESS
Returns
Others Some error occurs.

Definition at line 370 of file PiSmmCommunicationPei.c.

◆ SetCommunicationContext()

VOID SetCommunicationContext ( IN EFI_SMM_COMMUNICATION_CONTEXT SmmCommunicationContext)

Set SMM communication context.

Parameters
SmmCommunicationContextSMM communication context.

Definition at line 156 of file PiSmmCommunicationPei.c.

Variable Documentation

◆ mPpiList

Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPeiSmmCommunicationPpiGuid,
&mSmmCommunicationPpi
}

Definition at line 123 of file PiSmmCommunicationPei.c.

◆ mSmmCommunicationPpi

EFI_PEI_SMM_COMMUNICATION_PPI mSmmCommunicationPpi = { Communicate }

Definition at line 121 of file PiSmmCommunicationPei.c.