TianoCore EDK2 master
|
#include <BlSupportSmm.h>
Go to the source code of this file.
Functions | |
EFI_STATUS | SaveSmmInfoForS3 (IN UINT8 BlSwSmiHandlerInput) |
PLD_GENERIC_REGISTER * | GetRegisterById (UINT64 Id) |
VOID | LockSmiGlobalEn (VOID) |
VOID | SmmFeatureLockOnS3 (VOID) |
VOID EFIAPI | SetSmrr (IN VOID *ProcedureArgument) |
VOID | SetSmrrOnS3 (VOID) |
EFI_STATUS EFIAPI | BlSwSmiHandler (IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context, IN OUT VOID *CommBuffer, IN OUT UINTN *CommBufferSize) |
EFI_STATUS EFIAPI | BlSupportSmmReadyToLockCallback (IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle) |
EFI_STATUS EFIAPI | BlSupportSmm (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
PLD_S3_COMMUNICATION | mPldS3Hob |
EFI_SMRAM_HOB_DESCRIPTOR_BLOCK * | mSmramHob = NULL |
PLD_SMM_REGISTERS * | mSmmRegisterHob = NULL |
UINT64 | mSmmFeatureControl = 0 |
This driver is used for SMM S3 support for the bootloader that doesn't support SMM. The payload would save SMM rebase info to SMM communication area. The bootloader is expected to rebase the SMM and trigger SMI by writting 0xB2 port with given value from SMM communication area. The paylaod SMM handler got chance to restore regs in S3 path.
Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file BlSupportSmm.c.
EFI_STATUS EFIAPI BlSupportSmm | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The driver's entry point.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
Others | Some error occurs when executing this entry point. |
Definition at line 345 of file BlSupportSmm.c.
EFI_STATUS EFIAPI BlSupportSmmReadyToLockCallback | ( | IN CONST EFI_GUID * | Protocol, |
IN VOID * | Interface, | ||
IN EFI_HANDLE | Handle | ||
) |
Lock SMI in this SMM ready to lock event.
Protocol | Points to the protocol's unique identifier |
Interface | Points to the interface instance |
Handle | The handle on which the interface was installed |
EFI_SUCCESS | SmmEventCallback runs successfully |
EFI_NOT_FOUND | The Fvb protocol for variable is not found. |
Definition at line 320 of file BlSupportSmm.c.
EFI_STATUS EFIAPI BlSwSmiHandler | ( | IN EFI_HANDLE | DispatchHandle, |
IN CONST VOID * | Context, | ||
IN OUT VOID * | CommBuffer, | ||
IN OUT UINTN * | CommBufferSize | ||
) |
Software SMI callback for restoring SMRR base and mask in S3 path.
[in] | DispatchHandle | The unique handle assigned to this handler by SmiHandlerRegister(). |
[in] | Context | Points to an optional handler context which was specified when the handler was registered. |
[in,out] | CommBuffer | A pointer to a collection of data in memory that will be conveyed from a non-SMM environment into an SMM environment. |
[in,out] | CommBufferSize | The size of the CommBuffer. |
EFI_SUCCESS | The interrupt was handled successfully. |
Definition at line 294 of file BlSupportSmm.c.
PLD_GENERIC_REGISTER * GetRegisterById | ( | UINT64 | Id | ) |
Get specified SMI register based on given register ID
[in] | Id | The register ID to get. |
NULL | The register is not found |
Definition at line 112 of file BlSupportSmm.c.
VOID LockSmiGlobalEn | ( | VOID | ) |
Set SMM SMI Global enable lock
Definition at line 132 of file BlSupportSmm.c.
EFI_STATUS SaveSmmInfoForS3 | ( | IN UINT8 | BlSwSmiHandlerInput | ) |
Save SMM rebase and SMI handler information to SMM communication area
The function detects SMM communication region for boot loader, if it is detected, it will save SMM rebase information and S3 SMI handler information to SMM communication region. Bootloader should consume these information in S3 path to restore smm base, and write the 0xB2 port to trigger SMI so that payload could resume S3 registers.
[in] | BlSwSmiHandlerInput | Value written to 0xB2 to trigger SMI handler. |
EFI_SUCCESS | Save SMM info success. |
Others | Failed to save SMM info. |
Definition at line 35 of file BlSupportSmm.c.
VOID EFIAPI SetSmrr | ( | IN VOID * | ProcedureArgument | ) |
Function to program SMRR base and mask.
[in] | ProcedureArgument | Pointer to SMRR_BASE_MASK structure. |
Definition at line 195 of file BlSupportSmm.c.
VOID SetSmrrOnS3 | ( | VOID | ) |
Set SMRR in S3 path.
Definition at line 210 of file BlSupportSmm.c.
VOID SmmFeatureLockOnS3 | ( | VOID | ) |
Check and set SMM feature lock bit and code check enable bit in S3 path.
Definition at line 169 of file BlSupportSmm.c.
PLD_S3_COMMUNICATION mPldS3Hob |
Definition at line 16 of file BlSupportSmm.c.
UINT64 mSmmFeatureControl = 0 |
Definition at line 19 of file BlSupportSmm.c.
PLD_SMM_REGISTERS* mSmmRegisterHob = NULL |
Definition at line 18 of file BlSupportSmm.c.
EFI_SMRAM_HOB_DESCRIPTOR_BLOCK* mSmramHob = NULL |
Definition at line 17 of file BlSupportSmm.c.