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

Go to the source code of this file.

Functions

STATIC VOID EFIAPI OnS3SaveStateInstalled (IN EFI_EVENT Event, IN VOID *Context)
 
STATIC EFI_STATUS EFIAPI SmmControl2DxeTrigger (IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN OUT UINT8 *CommandPort OPTIONAL, IN OUT UINT8 *DataPort OPTIONAL, IN BOOLEAN Periodic OPTIONAL, IN UINTN ActivationInterval OPTIONAL)
 
STATIC EFI_STATUS EFIAPI SmmControl2DxeClear (IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN BOOLEAN Periodic OPTIONAL)
 
EFI_STATUS EFIAPI SmmControl2DxeEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC UINTN mSmiEnable
 
STATIC BOOLEAN mSmiFeatureNegotiation
 
STATIC EFI_EVENT mS3SaveStateInstalled
 
STATIC EFI_SMM_CONTROL2_PROTOCOL mControl2
 

Detailed Description

A DXE_RUNTIME_DRIVER providing synchronous SMI activations via the EFI_SMM_CONTROL2_PROTOCOL.

We expect the PEI phase to have covered the following:

  • ensure that the underlying QEMU machine type be Q35 (responsible: OvmfPkg/SmmAccess/SmmAccessPei.inf)
  • ensure that the ACPI PM IO space be configured (responsible: OvmfPkg/PlatformPei/PlatformPei.inf)

Our own entry point is responsible for confirming the SMI feature and for configuring it.

Copyright (C) 2013, 2015, Red Hat, Inc.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.

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

Definition in file SmmControl2Dxe.c.

Function Documentation

◆ OnS3SaveStateInstalled()

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

Notification callback for S3SaveState installation.

Parameters
[in]EventEvent whose notification function is being invoked.
[in]ContextThe pointer to the notification function's context, which is implementation-dependent.

Definition at line 339 of file SmmControl2Dxe.c.

◆ SmmControl2DxeClear()

STATIC EFI_STATUS EFIAPI SmmControl2DxeClear ( IN CONST EFI_SMM_CONTROL2_PROTOCOL This,
IN BOOLEAN Periodic  OPTIONAL 
)

Clears any system state that was created in response to the Trigger() call.

This function acknowledges and causes the deassertion of the SMI activation source.

Parameters
[in]ThisThe EFI_SMM_CONTROL2_PROTOCOL instance.
[in]PeriodicOptional parameter to repeat at this period one time
Return values
EFI_SUCCESSThe SMI/PMI has been engendered.
EFI_DEVICE_ERRORThe source could not be cleared.
EFI_INVALID_PARAMETERThe service did not support the Periodic input argument.

Definition at line 138 of file SmmControl2Dxe.c.

◆ SmmControl2DxeEntryPoint()

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

Definition at line 175 of file SmmControl2Dxe.c.

◆ SmmControl2DxeTrigger()

STATIC EFI_STATUS EFIAPI SmmControl2DxeTrigger ( IN CONST EFI_SMM_CONTROL2_PROTOCOL This,
IN OUT UINT8 *CommandPort  OPTIONAL,
IN OUT UINT8 *DataPort  OPTIONAL,
IN BOOLEAN Periodic  OPTIONAL,
IN UINTN ActivationInterval  OPTIONAL 
)

Invokes SMI activation from either the preboot or runtime environment.

This function generates an SMI.

Parameters
[in]ThisThe EFI_SMM_CONTROL2_PROTOCOL instance.
[in,out]CommandPortThe value written to the command port.
[in,out]DataPortThe value written to the data port.
[in]PeriodicOptional mechanism to engender a periodic stream.
[in]ActivationIntervalOptional parameter to repeat at this period one time or, if the Periodic Boolean is set, periodically.
Return values
EFI_SUCCESSThe SMI/PMI has been engendered.
EFI_DEVICE_ERRORThe timing is unsupported.
EFI_INVALID_PARAMETERThe activation period is unsupported.
EFI_INVALID_PARAMETERThe last periodic activation has not been cleared.
EFI_NOT_STARTEDThe SMM base service has not been initialized.

Definition at line 89 of file SmmControl2Dxe.c.

Variable Documentation

◆ mControl2

Initial value:
= {
MAX_UINTN
}
STATIC EFI_STATUS EFIAPI SmmControl2DxeClear(IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN BOOLEAN Periodic OPTIONAL)
STATIC EFI_STATUS EFIAPI SmmControl2DxeTrigger(IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN OUT UINT8 *CommandPort OPTIONAL, IN OUT UINT8 *DataPort OPTIONAL, IN BOOLEAN Periodic OPTIONAL, IN UINTN ActivationInterval OPTIONAL)

Definition at line 164 of file SmmControl2Dxe.c.

◆ mS3SaveStateInstalled

STATIC EFI_EVENT mS3SaveStateInstalled

Definition at line 63 of file SmmControl2Dxe.c.

◆ mSmiEnable

STATIC UINTN mSmiEnable

Definition at line 51 of file SmmControl2Dxe.c.

◆ mSmiFeatureNegotiation

STATIC BOOLEAN mSmiFeatureNegotiation

Definition at line 58 of file SmmControl2Dxe.c.