TianoCore EDK2 master
Loading...
Searching...
No Matches
SmmStm.h File Reference

Go to the source code of this file.

Functions

VOID StmGen4GPageTable (IN UINTN PageTableBase)
 
UINT32 EFIAPI SmmStmExceptionHandler (IN OUT STM_PROTECTION_EXCEPTION_STACK_FRAME Context)
 
EFI_SM_MONITOR_STATE EFIAPI GetMonitorState (VOID)
 
EFI_STATUS EFIAPI LoadMonitor (IN EFI_PHYSICAL_ADDRESS StmImage, IN UINTN StmImageSize)
 
EFI_STATUS EFIAPI AddPiResource (IN STM_RSC *ResourceList, IN UINT32 NumEntries OPTIONAL)
 
EFI_STATUS EFIAPI DeletePiResource (IN STM_RSC *ResourceList, IN UINT32 NumEntries OPTIONAL)
 
EFI_STATUS EFIAPI GetPiResource (OUT STM_RSC *ResourceList, IN OUT UINT32 *ResourceSize)
 
VOID StmSmmConfigurationTableInit (VOID)
 
VOID NotifyStmResourceChange (IN VOID *StmResource)
 
VOID * GetStmResource (VOID)
 
VOID EFIAPI SmmCpuFeaturesLibStmSmiEntryFixupAddress ()
 

Detailed Description

SMM STM support

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

Definition in file SmmStm.h.

Function Documentation

◆ AddPiResource()

EFI_STATUS EFIAPI AddPiResource ( IN STM_RSC ResourceList,
IN UINT32 NumEntries  OPTIONAL 
)

Add resources in list to database. Allocate new memory areas as needed.

Parameters
ResourceListA pointer to resource list to be added
NumEntriesOptional number of entries. If 0, list must be terminated by END_OF_RESOURCES.
Return values
EFI_SUCCESSIf resources are added
EFI_INVALID_PARAMETERIf nested procedure detected resource failer
EFI_OUT_OF_RESOURCESIf nested procedure returned it and we cannot allocate more areas.

Definition at line 880 of file SmmStm.c.

◆ DeletePiResource()

EFI_STATUS EFIAPI DeletePiResource ( IN STM_RSC ResourceList,
IN UINT32 NumEntries  OPTIONAL 
)

Delete resources in list to database.

Parameters
ResourceListA pointer to resource list to be deleted NULL means delete all resources.
NumEntriesOptional number of entries. If 0, list must be terminated by END_OF_RESOURCES.
Return values
EFI_SUCCESSIf resources are deleted
EFI_INVALID_PARAMETERIf nested procedure detected resource failer

Definition at line 988 of file SmmStm.c.

◆ GetMonitorState()

EFI_SM_MONITOR_STATE EFIAPI GetMonitorState ( VOID  )

Get STM state.

Returns
STM state

Definition at line 446 of file SmmStm.c.

◆ GetPiResource()

EFI_STATUS EFIAPI GetPiResource ( OUT STM_RSC ResourceList,
IN OUT UINT32 *  ResourceSize 
)

Get BIOS resources.

Parameters
ResourceListA pointer to resource list to be filled
ResourceSizeOn input it means size of resource list input. On output it means size of resource list filled, or the size of resource list to be filled if size of too small.
Return values
EFI_SUCCESSIf resources are returned.
EFI_BUFFER_TOO_SMALLIf resource list buffer is too small to hold the whole resources.

Definition at line 1023 of file SmmStm.c.

◆ GetStmResource()

VOID * GetStmResource ( VOID  )

This function return BIOS STM resource.

Returns
BIOS STM resource

This function return BIOS STM resource. Produced by SmmStm. Consumed by SmmMpService when Init.

Returns
BIOS STM resource

Definition at line 1250 of file SmmStm.c.

◆ LoadMonitor()

EFI_STATUS EFIAPI LoadMonitor ( IN EFI_PHYSICAL_ADDRESS  StmImage,
IN UINTN  StmImageSize 
)

Load STM image to MSEG.

Parameters
StmImageSTM image
StmImageSizeSTM image size
Return values
EFI_SUCCESSLoad STM to MSEG successfully
EFI_BUFFER_TOO_SMALLMSEG is smaller than minimal requirement of STM image

Load STM image to MSEG.

Parameters
StmImageSTM image
StmImageSizeSTM image size
Return values
EFI_SUCCESSLoad STM to MSEG successfully
EFI_ALREADY_STARTEDSTM image is already loaded to MSEG
EFI_BUFFER_TOO_SMALLMSEG is smaller than minimal requirement of STM image
EFI_UNSUPPORTEDMSEG is not enabled

Definition at line 1204 of file SmmStm.c.

◆ NotifyStmResourceChange()

VOID NotifyStmResourceChange ( IN VOID *  StmResource)

This function notify STM resource change.

Parameters
StmResourceBIOS STM resource

◆ SmmCpuFeaturesLibStmSmiEntryFixupAddress()

VOID EFIAPI SmmCpuFeaturesLibStmSmiEntryFixupAddress ( )

This function fixes up the address of the global variable or function referred in SmiEntry assembly files to be the absolute address.

◆ SmmStmExceptionHandler()

UINT32 EFIAPI SmmStmExceptionHandler ( IN OUT STM_PROTECTION_EXCEPTION_STACK_FRAME  Context)

This is SMM exception handle. Consumed by STM when exception happen.

Parameters
ContextSTM protection exception stack frame
Returns
the EBX value for STM reference. EBX = 0: resume SMM guest using register state found on exception stack. EBX = 1 to 0x0F: EBX contains a BIOS error code which the STM must record in the TXT.ERRORCODE register and subsequently reset the system via TXT.CMD.SYS_RESET. The value of the TXT.ERRORCODE register is calculated as follows: TXT.ERRORCODE = (EBX & 0x0F) | STM_CRASH_BIOS_PANIC EBX = 0x10 to 0xFFFFFFFF - reserved, do not use.

Definition at line 65 of file SmmStmSupport.c.

◆ StmGen4GPageTable()

VOID StmGen4GPageTable ( IN UINTN  PageTableBase)

Create 4G page table for STM. 2M PAE page table in X64 version.

Parameters
PageTableBaseThe page table base in MSEG

Create 4G page table for STM. 4M Non-PAE page table in IA32 version.

Parameters
PageTableBaseThe page table base in MSEG

Definition at line 30 of file SmmStmSupport.c.

◆ StmSmmConfigurationTableInit()

VOID StmSmmConfigurationTableInit ( VOID  )

This function initialize STM configuration table.

This function initializes the STM configuration table.

Definition at line 410 of file SmmStm.c.