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

Go to the source code of this file.

Data Structures

struct  PROCESSOR_SMM_DESCRIPTOR
 

Macros

#define LMA   BIT10
 

Functions

UINTN EFIAPI GetSmiHandlerSize (VOID)
 
VOID EFIAPI InstallSmiHandler (IN UINTN CpuIndex, IN UINT32 SmBase, IN VOID *SmiStack, IN UINTN StackSize, IN UINTN GdtBase, IN UINTN GdtSize, IN UINTN IdtBase, IN UINTN IdtSize, IN UINT32 Cr3)
 

Variables

CONST PROCESSOR_SMM_DESCRIPTOR gcPsd
 
X86_ASSEMBLY_PATCH_LABEL gPatchSmbase
 
X86_ASSEMBLY_PATCH_LABEL gPatchSmiStack
 
X86_ASSEMBLY_PATCH_LABEL gPatchSmiCr3
 
volatile UINT8 gcSmiHandlerTemplate []
 
CONST UINT16 gcSmiHandlerSize
 
IA32_DESCRIPTOR gSmiHandlerIdtr
 
UINT8 mSmmSaveStateRegisterLma
 

Detailed Description

Provides services to access SMRAM Save State Map

Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.

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

Definition in file SmramSaveState.c.

Macro Definition Documentation

◆ LMA

#define LMA   BIT10

Definition at line 51 of file SmramSaveState.c.

Function Documentation

◆ GetSmiHandlerSize()

UINTN EFIAPI GetSmiHandlerSize ( VOID  )

Get the size of the SMI Handler in bytes.

Return values
Thesize, in bytes, of the SMI Handler.

Definition at line 80 of file SmramSaveState.c.

◆ InstallSmiHandler()

VOID EFIAPI InstallSmiHandler ( IN UINTN  CpuIndex,
IN UINT32  SmBase,
IN VOID *  SmiStack,
IN UINTN  StackSize,
IN UINTN  GdtBase,
IN UINTN  GdtSize,
IN UINTN  IdtBase,
IN UINTN  IdtSize,
IN UINT32  Cr3 
)

Install the SMI handler for the CPU specified by CpuIndex. This function is called by the CPU that was elected as monarch during System Management Mode initialization.

Parameters
[in]CpuIndexThe index of the CPU to install the custom SMI handler. The value must be between 0 and the NumberOfCpus field in the System Management System Table (SMST).
[in]SmBaseThe SMBASE address for the CPU specified by CpuIndex.
[in]SmiStackThe stack to use when an SMI is processed by the the CPU specified by CpuIndex.
[in]StackSizeThe size, in bytes, if the stack used when an SMI is processed by the CPU specified by CpuIndex.
[in]GdtBaseThe base address of the GDT to use when an SMI is processed by the CPU specified by CpuIndex.
[in]GdtSizeThe size, in bytes, of the GDT used when an SMI is processed by the CPU specified by CpuIndex.
[in]IdtBaseThe base address of the IDT to use when an SMI is processed by the CPU specified by CpuIndex.
[in]IdtSizeThe size, in bytes, of the IDT used when an SMI is processed by the CPU specified by CpuIndex.
[in]Cr3The base address of the page tables to use when an SMI is processed by the CPU specified by CpuIndex.

Definition at line 120 of file SmramSaveState.c.

Variable Documentation

◆ gPatchSmbase

X86_ASSEMBLY_PATCH_LABEL gPatchSmbase

Variables from SMI Handler

Definition at line 56 of file SmramSaveState.c.

◆ gPatchSmiCr3

X86_ASSEMBLY_PATCH_LABEL gPatchSmiCr3

Definition at line 58 of file SmramSaveState.c.

◆ gPatchSmiStack

X86_ASSEMBLY_PATCH_LABEL gPatchSmiStack

Definition at line 57 of file SmramSaveState.c.

◆ gSmiHandlerIdtr

IA32_DESCRIPTOR gSmiHandlerIdtr

Definition at line 65 of file SmramSaveState.c.

◆ mSmmSaveStateRegisterLma

UINT8 mSmmSaveStateRegisterLma

The mode of the CPU at the time an SMI occurs

Definition at line 70 of file SmramSaveState.c.