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

Go to the source code of this file.

Data Structures

struct  SMM_CONTROL2_REG
 

Macros

#define SMM_DATA_PORT   0xB3
 
#define SMM_CONTROL_PORT   0xB2
 

Functions

EFI_STATUS EFIAPI Activate (IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN OUT UINT8 *CommandPort OPTIONAL, IN OUT UINT8 *DataPort OPTIONAL, IN BOOLEAN Periodic OPTIONAL, IN EFI_SMM_PERIOD ActivationInterval OPTIONAL)
 
EFI_STATUS EFIAPI Deactivate (IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN BOOLEAN Periodic)
 
PLD_GENERIC_REGISTERGetSmmCtrlRegById (IN PLD_SMM_REGISTERS *SmmRegister, IN UINT32 Id)
 
VOID EFIAPI SmmControlVirtualAddressChangeEvent (IN EFI_EVENT Event, IN VOID *Context)
 
EFI_STATUS EFIAPI SmmControlEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

SMM_CONTROL2_REG mSmiCtrlReg
 
EFI_SMM_CONTROL2_PROTOCOL mSmmControl2
 

Detailed Description

This module produces the SMM Control2 Protocol

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

Definition in file SmmControlRuntimeDxe.c.

Macro Definition Documentation

◆ SMM_CONTROL_PORT

#define SMM_CONTROL_PORT   0xB2

Definition at line 20 of file SmmControlRuntimeDxe.c.

◆ SMM_DATA_PORT

#define SMM_DATA_PORT   0xB3

Definition at line 19 of file SmmControlRuntimeDxe.c.

Function Documentation

◆ Activate()

EFI_STATUS EFIAPI Activate ( IN CONST EFI_SMM_CONTROL2_PROTOCOL This,
IN OUT UINT8 *CommandPort  OPTIONAL,
IN OUT UINT8 *DataPort  OPTIONAL,
IN BOOLEAN Periodic  OPTIONAL,
IN EFI_SMM_PERIOD 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 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 MM base service has not been initialized.

Definition at line 50 of file SmmControlRuntimeDxe.c.

◆ Deactivate()

EFI_STATUS EFIAPI Deactivate ( IN CONST EFI_SMM_CONTROL2_PROTOCOL This,
IN BOOLEAN  Periodic 
)

Clears an SMI.

Parameters
ThisPointer to an instance of EFI_SMM_CONTROL2_PROTOCOL
PeriodicTRUE to indicate a periodical SMI
Returns
Return value from SmmClear ()

Definition at line 90 of file SmmControlRuntimeDxe.c.

◆ GetSmmCtrlRegById()

PLD_GENERIC_REGISTER * GetSmmCtrlRegById ( IN PLD_SMM_REGISTERS SmmRegister,
IN UINT32  Id 
)

Get specified SMI register based on given register ID

Parameters
[in]SmmRegisterSMI related register array from bootloader
[in]IdThe register ID to get.
Return values
NULLThe register is not found or the format is not expected.
Returns
smi register

Definition at line 125 of file SmmControlRuntimeDxe.c.

◆ SmmControlEntryPoint()

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

This function installs EFI_SMM_CONTROL2_PROTOCOL.

Parameters
ImageHandleHandle for the image of this driver
SystemTablePointer to the EFI System Table
Return values
EFI_UNSUPPORTEDThere's no Intel ICH on this platform
Returns
The status returned from InstallProtocolInterface().

Definition at line 197 of file SmmControlRuntimeDxe.c.

◆ SmmControlVirtualAddressChangeEvent()

VOID EFIAPI SmmControlVirtualAddressChangeEvent ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Fixup data pointers so that the services can be called in virtual mode.

Parameters
[in]EventThe event registered.
[in]ContextEvent context.

Definition at line 176 of file SmmControlRuntimeDxe.c.

Variable Documentation

◆ mSmiCtrlReg

SMM_CONTROL2_REG mSmiCtrlReg

Definition at line 28 of file SmmControlRuntimeDxe.c.

◆ mSmmControl2

Initial value:
= {
0
}
EFI_STATUS EFIAPI Activate(IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN OUT UINT8 *CommandPort OPTIONAL, IN OUT UINT8 *DataPort OPTIONAL, IN BOOLEAN Periodic OPTIONAL, IN EFI_SMM_PERIOD ActivationInterval OPTIONAL)
EFI_STATUS EFIAPI Deactivate(IN CONST EFI_SMM_CONTROL2_PROTOCOL *This, IN BOOLEAN Periodic)

SMM COntrol2 Protocol instance

Definition at line 108 of file SmmControlRuntimeDxe.c.